Earlier the MQM, a party that supports Musharraf, withdrew its candidate for prime minster, calling the move a "goodwill gesture" and paving the way for a PPP candidate to stand unopposed.
Coalition leader
There had been speculation the PPP would nominate a stop-gap prime minister until Asif Ali Zardari, Bhutto's husband and the party leader becomes eligible to stand for the post by contesting a by-election in May.
Zardari is currently ineligible to stand as he is not a member of parliament.
Gilani was the "consensus" candidate of the coalition, a statement said, read out to reporters in Islamabad by Farhatullah Babar, the PPP spokesman.
"I have great pleasure in calling upon Yousaf Raza Gilani in the name of the martyr Benazir Bhutto to accept the heavy responsibility to lead the coalition government and the nation," Zardari said in the statement.
Analysts said the Gilani's appointment, a low-key Bhutto loyalist, was likely to add to speculation Zardari would seek to become prime minister.
"It's not a nomination you'd expect for a five-year term," said Masooda Bano, a political analyst.
"He's proved his loyalty but even in the public mind he doesn't have that strong a presence."
"Acceptable to everyone"
But Kamal Hyder, Al Jazeera's correspondent in Islamabad, said Gillani, who comes from the Punjab region, could be a consensus candidate.
"This could be a man who is acceptable to everyone. He also hails for the country's most powerful province [the Punjab]."
He added the move could be used by the PPP to "improve its standing in the province".
The naming of a candidate had been stalled for weeks, fueling the speculation that Zardari wanted the job for himself.
He shares control of the PPP with Bilawal Bhutto Zardari, his son, who recently returned to Pakistan for a short break from Britain where he is studying.
The 19-year-old was appointed after his mother's assassination on December 27 but said he will complete his studies at Oxford University before entering politics.