Prodi won by 165 votes to 155. All seven of Italy's unelected senators for life voted "yes" in Prodi's support.
"It couldn't have gone better," Prodi said after winning the vote on Friday.
The vote was the first, and more difficult, of two parliamentary confidence votes which are required before Prodi's government can start work.
Prodi must seek a second vote of confidence next week from the lower house of parliament, where his coalition holds a comfortable majority.
Instead of being a mere symbolic rite of passage, the senate vote was an uncomfortable test for Prodi as the tiny majority he scraped at the general election last month meant that he needed all his senators to be present and voting for him.
Prodi's centre-left administration has 158 senate seats, against 156 for the opposition led by Silvio Berlusconi, the former prime minister who still contests the election result and has predicted that the new government will soon collapse.
"We have a solid and cohesive majority in both chambers"
Italian prime minister
Prodi was booed by centre-riht senators when he said in a speech before the vote: "We have a solid and cohesive majority in both chambers."
Cracks in coalition
Although Prodi survived the first test, the tension revealed cracks in his coalition - an array of parties stretching from the centre to the hard left.
Italy of Values, a junior government party, threatened to vote against Prodi in protest at his decision not to appoint a cabinet minister in charge of the interests of Italians abroad. It withdrew the threat at the last moment.
In his senate speech, Prodi reiterated that Italy would withdraw its troops from Iraq before the end of the year, but said he would still co-operate with the US in its so-called war on terror.
"Something that struck me [in the parliamentary debate] was the discussion about the fight on terrorism, and I have to say we won't accept lessons from anyone on that," Prodi said.