Bilal Abu Ghanem was one of two Palestinians who carried out the October 13 attack that killed two Israelis and a US-Israeli dual national.
The second attacker, Bahaa Allyan, was shot dead during the attack.
According to the court, Abu Ghanem, a resident of the east Jerusalem Jabel Mukaber neighbourhood, opened fire on the bus with a pistol, shooting 14 rounds, while Allyan stabbed passengers.
He was also ordered to pay 1.45 million shekels (USD 373,000/338,000 euros) in compensation to victims' families, including four people wounded and the bus driver.
More From This Section
When leaving the court, Abu Ghanem, who was imprisoned in 2013 for membership in the militant Hamas movement, lashed out and said the attack was in part meant as revenge for what he and other Palestinians see as violations of the Al-Aqsa mosque compound in Jerusalem.
The attack followed a series of clashes in September between Palestinian youths and Israeli police at the flashpoint holy site.
The bus attack was part of a wave of violence that began in October and which has killed at least 214 Palestinians, 34 Israelis, two Americans, an Eritrean and a Sudanese.
Most of the Palestinians killed were carrying out knife, gun or car-ramming attacks, according to Israeli authorities.
Others were shot dead during protests and clashes, while some were killed by Israeli air strikes in the Gaza Strip.
The violence has steadily declined in recent months, though attacks continue to occur, including the fatal stabbing of a 13-year-old girl by a Palestinian in her home in a settlement in the occupied West Bank on June 30.