Saudi security forces killed four al Qaeda members in a shootout and launched a dragnet in Riyadh that captured 12 others in the aftermath of the beheading of an American defense contractor, Saudi officials said Saturday.

Saudi authorities said that the four militants, who were on a list of most-wanted terrorism suspects, were killed late Friday just after the group, calling itself al Qaeda in the Arabian Peninsula, distributed a video depicting the headless body of Paul M. Johnson Jr., 49, an employee of Bethesda-based Lockheed Martin Corp. Johnson, who was kidnapped six days earlier, was one of three American military contractors slain in Riyadh, the Saudi capital, in the past two weeks.

In Riyadh, Saudi television aired footage of the battered bodies of the militants whom authorities said died in a shootout at a Riyadh gas station. Among them was Abdulaziz Muqrin, the leader of the al Qaeda cell.

The security operation deactivated most of the cell, which was responsible for a number of recent attacks in Saudi Arabia, the officials said. The Saudi Interior Ministry said that the militants had been involved in several terrorist attacks in the past seven months, including the Nov. 9 bombing of a foreigners' residential compound in Riyadh and the slaying of 22 people last month at another compound for foreigners in Khobar.

The ministry said police had separately seized a car used by gunmen who fatally shot a BBC cameraman and critically wounded a BBC correspondent in Riyadh on June 6. The officials also said that one of those arrested was a suspected planner of the 2000 bombing of the USS Cole in Yemen.

Saudi officials said the security operation had severely weakened the capabilities of Islamic extremists who began operations 13 months ago in the country, adding that Muqrin's group was the only known al Qaeda cell remaining in the country. But they stopped short of declaring the kingdom a safe place for the 35,000 Americans and other foreigners who work and live there, cautioning that more attacks were possible.

"We will continue our hunt for others in the kingdom who are members of this evil group or who may be supporters of this group," Adel Jubeir, foreign policy adviser to Crown Prince Abdullah, said at a news conference in Washington. "We will show no mercy."

Since March, when Muqrin declared himself the new leader of al Qaeda operations in Saudi Arabia, he had taunted the Saudi royal family for its inability to find him or his followers. In frequent statements posted on the Internet, Muqrin suggested that his group's ability to attack and kill foreigners at will was evidence of the righteousness of its cause.

Ramzi Khouri, an editorial director of the Saudi Gazette newspaper, described Muqrin as a charismatic outlaw with a flair for public relations. Muqrin took a leading role in polished video and audio files that the group posted on the Internet, offering elaborate religious justifications for the attacks on foreigners.

"Al Qaeda needs to make it very personal, to create these symbols who can become very popular with the public, like Osama bin Laden," Khouri said in a telephone interview from Jiddah. "Muqrin was one heck of a speaker. . . . He was becoming a hero to many people. If he had been able to keep going for a while, he have become another Che Guevara."

At the same time, Khouri said the al Qaeda leader's death would not end the uprising, just as the demise of several of his predecessors at the hands of Saudi forces did little to slow the pace of the attacks.

"They have not gotten rid of al Qaeda by any means," he said. "There are more people from where this cell came from."

U.S. and Saudi officials said reports that Johnson's body had been recovered were incorrect, adding late Saturday that they were still looking for his remains. But they said a video showing his decapitated corpse was genuine and that they had no doubt he was dead.

Johnson was kidnapped June 12, the same day that gunmen fatally shot Kenneth Scroggs, another American defense contractor who worked out of the same office in Riyadh.

Muqrin's group later released a video on the Internet of a blindfolded Johnson, threatening to kill him unless the Saudi government released an unspecified number of militants from prison. Saudi officials disclosed few details about how they tracked down Muqrin. At first, authorities in Riyadh said a witness had seen a car dump Johnson's body and took down the license plate number, but Jubeir and other officials later said that was not the case.

Jubeir said 15,000 Saudi security forces had swept through Riyadh block by block in their search for Johnson and his killers. Late Friday, security forces setting up a roadblock trapped Muqrin and three other militants in a car, although Jubeir said he didn't know if the confrontation occurred by happenstance or because of specific intelligence of Muqrin's whereabouts.

The gunfight lasted about two hours, Jubeir said. "The terrorists tried to shoot their way out," he added. Saudi television showed broken glass, bloodstains and other evidence of the shootout at a gas station in central Riyadh.

Al Qaeda acknowledged the death of Muqrin on the Internet, after an earlier claim that he was alive and well.

Jubeir described one of the other dead militants, Faisal Dakheel, as the "number two al Qaeda leader in Saudi Arabia."

Also killed were Turki Muteiri, one of three gunmen wanted for the May 29 attack in Khobar; and Ibrahim Dreihim, suspected of planning the suicide bombing at the Western compound in Riyadh last November, according to the official Saudi Press Agency.

The dozen militants who were arrested elsewhere during the sweeps in Riyadh included Rakan Saikhan, one of the Saudi government's 26 most-wanted terrorism suspects and an alleged conspirator in the attack on the Cole, a Saudi security source said. The Interior Ministry said police also confiscated large caches of weapons, including three rocket-propelled grenade launchers, computers and $30,000 in cash.

"This is a monumental blow to the cohesive operational structure of Muqrin's operation," Nawaf Obaid, a security consultant to the Saudi government, said in a telephone interview from London.

The State Department has been urging Americans to leave Saudi Arabia since April, and the U.S. Embassy in Riyadh issued an even stronger warning late Thursday, saying that Americans were being shadowed by militants.

On Saturday, U.S. Ambassador James C. Oberwetter said the security situation had improved but that the country remained a dangerous place.

"It will be some time before we achieve a comfort level that the situation returns to normal," Oberwetter said at a news conference in Riyadh. "The Saudis are doing an excellent job working on their most-wanted list and taking people off that list. . . . But not everyone has been removed from the list. Maybe there are more."

Abdulaziz Muqrin was one of four suspected terrorists trapped by Saudi security forces at a roadblock.