Two suspected terrorists blew themselves up as police were closing in Tuesday and another suspect was shot dead by police as he prepared to detonate his explosives, authorities said. A police officer was reported killed. A bloody pair of legs were seen lying in the middle of a road after one of the blasts in Casablanca, Morocco's largest city. Police covered up the legs, shorn off at the knees, with pieces of cardboard. Broken glass and charred debris littered the street. The explosions, weeks after the bombing of a Casablanca Internet cafe, promised to further rattle the North African kingdom whose first high-profile brush with Islamic terrorism came in five suicide bombings in the city in May 2003. Moroccan authorities responded to those attacks, which left 45 people dead, with the arrest of thousands of alleged Islamic militants - some accused of working with al-Qaida to plot strikes in Morocco and abroad. Parliamentary elections are scheduled in September. The opposition Justice and Development Party, an Islamic group, is expected to win the most votes. Tuesday's violence started when police, acting on a tip, surrounded a four-story apartment building in the working-class Hay Farah neighborhood of Casablanca, where the suspected terrorists were holed up, officials said. One of the suspects fled to the roof, where he blew himself up, said a police official on the scene who refused to give his name, saying he was not authorized to do so. Morocco's official MAP news agency identified the bomber as Mohamed Rachidi. A second man appeared to be on the verge of also detonating explosives, fumbling with his clothes, when a police sniper shot him, officials said. The suspect later died of his wounds. He was identified by police as Mohamed Mentala. Mentala was carrying 4 kilograms of explosives, an Interior Ministry spokesman said. Mentala and Rachidi had both been sought by police for alleged involvement in the 2003 suicide bombings in Casablanca, said the Interior Ministry official, who asked not to be named, citing ministry policy. MAP said Rachidi, 37, was part of a terrorist cell involved in the killing of a Casablanca police official in 2003. A third suspect fled Tuesday, and he blew himself up in the afternoon as police were searching the neighborhood for him, according to another officer at the scene, who also refused to give his name. The officer said police were also hunting for a fourth suspect, who was believed to be hiding in buildings nearby. MAP said the afternoon blast seriously injured a police officer, and that he died as he was being transferred to a hospital. A second officer suffered light injuries, MAP said. It said that the bomber had not yet been identified. Police had cordoned off the area, and an ambulance with sirens wailing quickly arrived at the scene. The suspects were allegedly linked to the March 11 bombing of an Internet cafe in Casablanca - an attack that killed the bomber and four others. Police investigations into that blast led them to a wider suspected plot to attack the city's port, police stations and tourist sites in Morocco. In that blast, bomber Abdelfettah Raydi detonated his charge when the cyber cafe's owner caught him surfing jihadist Web sites. Authorities say the subsequent investigation uncovered a larger plot that involved at least 30 people. The group had amassed dozens of kilograms of homemade explosives in a Casablanca apartment. Police have so far arrested 31 suspects, who have been questioned by judges in preliminary court hearings. Raydi and many other suspects were among some 2,000 arrested after the 2003 bombings, but were later released from prison under a royal pardon. Moroccan authorities have said they do not believe Raydi's group had links to international terrorist networks.