The men, one of them a soldier, were arrested after bombers tried to ram two explosives-laden vehicles into Musharraf’s motorcade on a road in the city of Rawalpindi, near the capital, Islamabad, on 25 December 2003, Major General Shaukat Sultan said on Monday.
Musharraf escaped unharmed, but 16 people, mostly the president’s police guards, were killed.
Three other civilians were given lesser sentences on Friday in connection with the plot, but Sultan declined to provide any further details.
Authorities have not said how any of the group were involved in the assassination attempt, and Sultan would not say where the trial, which was closed to the media and the public, was held.
The attack came 11 days after the al-Qaida group allegedly tried to kill Musharraf by blowing up his motorcade on a bridge in Rawalpindi.
Musharraf, who made Pakistan a key ally of the United States in its “war on terror” after 11 September 2001, has survived at least three known attempts on his life – one in the southern city of Karachi and two in Rawalpindi.
Musharraf has blamed Abu Farraj al-Libbi, an alleged leader of al-Qaida, for being behind the two attacks against him in Rawalpindi.
Al-Libbi was arrested in northwestern Pakistan in May and later handed over to US authorities.
The latest court decision came days after a Pakistani soldier, Islam Sadiqqui, was hanged at a jail in the central city of Multan for his role in the attempt to kill Musharraf on the Rawalpindi bridge.