made the comments during an interview with Pakistan's private Aaj television news channel.
General Musharraf said neither of the former prime ministers would be allowed back into the country for national elections expected later this year.
"About the return before the elections, no, nobody is returning before elections."
The interview would seem to end speculation that Musharraf was seeking a political deal with at least one of his long time rivals.
The president, who is seeking another five-year term in office, faces mounting domestic opposition over his decision to remove the country's popular chief justice several months ago.
The dismissal has become a rallying point for the president's critics, in a significant challenge to the military-backed government.
General Musharraf had been reportedly exploring a possible alliance with former Prime Minister Benazir Bhutto, who heads the country's largest opposition group, the Pakistan People's Party. But talk of political accommodation ended earlier this week after political clashes in the southern city of Karachi, where 40 people were killed as pro-government forces fought with opposition activists.
Samina Ahmed is the director in Pakistan of the Brussels-based International Crisis Group. She says the president can no longer count on any outside support to broaden his political base.
"I think after Karachi and the deaths there it would be difficult for a political party now to retain its own democratic credibility if it enters into a power-sharing agreement with General Musharraf."
Both Benazir Bhutto and Nawaz Sharif have said they hoped to return to Pakistan later this year. Ms. Bhutto has lived in self-imposed exile since 1999 when she fled Pakistan to avoid corruption and graft charges from her time in office.
Mr. Sharif was forced into exile several months later. Both former prime ministers have criticized General Musharraf's decision to remove the country's top judge and his refusal to give up his dual posts as president and military chief.