The 180-2 vote — with 132 abstentions, which in the Senate count as "no" votes — gave final approval to a government decree that provides funding for all Italian missions abroad. The lower house of parliament approved it earlier this month.
There has been increasing violence in Afghanistan and controversy over the release of an Italian hostage who was kidnapped there.
Italy has about 2,000 troops in Afghanistan, deployed between Kabul and Herat, far from the more restive south of the country. But a series of small incidents involving the Italians and reports of heavy fighting elsewhere in the country are heightening concerns in Italy over the troops' security.
Addressing those concerns, the government has asked military chiefs to assess the security conditions on the ground and indicate whether the troops need heavier armaments to ensure their safety, Foreign Minister Massimo D'Alema told senators shortly before the vote.
Communists and other hardline leftists in the coalition are opposed to the mission and want a troop withdrawal. But Prodi has resisted those calls, as well as NATO demands to beef up the contingent.
The premier, on a diplomatic tour in Latin America, was not present at the vote.
Center-left forces have a one-seat edge in the Senate. But despite the defection of a few coalition radical leftists, the majority was able to pass the measure thanks to support from some of seven honorary senators appointed for life.
One centrist party outside of the government coalition also voted with the center-left, while former Premier Silvio Berlusconi's party and other opposition senators abstained in an effort to topple the government.
Prodi resigned weeks ago after he lost a Senate vote on foreign policy, including on Afghanistan's mission. He was asked to stay on by the president and won back-to-back confidence votes in parliament.
In the run-up to the vote, the government has come under fire for its handling of a hostage crisis involving Italian reporter Daniele Mastrogiacomo.
The correspondent for La Repubblica was freed March 19, after two weeks in the hands of his abductors, in exchange for the release of five Taliban prisoners. The tactics drew the criticism of Washington and European capitals alike, amid fears that the swap might turn foreigners into the targets of kidnapping and concerns that Italy had given in to the demands of terrorists.
Prodi has insisted that Italy was not directly involved in the prisoner swap.
At a meeting in Brussels on Tuesday, NATO Secretary General Jaap de Hoop Scheffer said he would open talks among the allies about forming a common position on how to deal with such situations.
"The actions of one country in this context can have implications for others," he said, cautioning against actions that could be an "incentive for others to do this kind of thing again."
NATO officials also said they hoped and expected that Italy would maintain its troops in Afghanistan.