QUETTA, Pakistan (AP) _ A Pakistani court convicted five Islamic militants Wednesday in connection with a bombing that killed 45 people at a Shiite shrine last year, a judge said. Two of the defendants were sentenced to death.

The men, all Pakistanis, were arrested two days after the March 19, 2005, attack in Fatehpur, a remote town about 500 miles southwest of the capital, Islamabad. The explosion occurred as religious pilgrims were eating dinner.

Judge Mohammed Ismail told The Associated Press by telephone that he issued the ruling Wednesday.

``They (the men) played a direct role in the bomb attack,'' he said.

The bomb exploded after about 20,000 people, mostly Shiite Muslims but also some Sunni Muslims, gathered at the shrine of a 19th century Shiite saint.

Pakistan, an Islamic nation with about 150 million people, has a history of violence between religious extremists from the majority Sunni and minority Shiite sects. The schism in Islam dates back to the 7th century.

Militants also have been angered by President Gen. Pervez Musharraf's support of the U.S.-led war against al-Qaida and the Taliban in neighboring Afghanistan.

Prosecution lawyer Deen Mohammed Marri said the accused confessed their involvement in the attack and links with an outlawed Sunni Muslim militant group blamed for previous violence in Pakistan.

``We had a very solid case and evidence against them,'' Marri said.

Mohammed Aslam and Abdul Aleem got the death penalty, and Mohammed Abdullah, Mohammed Arshad and Khalil Ahmad received life sentences.

Lawyers for the convicted men could not immediately be reached for comment. They have the right to appeal the conviction and sentencing.

Marri said the five men were arrested at a home adjacent to a mosque in the same region as the shrine attack after a bomb they were making exploded. One suspect was wounded.