Swiss special forces stormed the Spanish consulate Monday, ending a nearly seven-hour standoff by three masked assailants who had seized hostages in what officials called an attempted robbery, police said.

The fate of the captors was not immediately clear. A special police unit entered the building around 2:30 p.m. (8:30 a.m. EST), said Juerg Mosimann, a police spokesman.

"We're relieved," said Mosimann, who declined to comment further.

The three assailants, believed to be armed with knives and a handgun, took over the consulate in the Swiss capital shortly before 8 a.m. (2 a.m. EST), taking three people hostage.

One captive, a security guard, was injured but managed to escape almost immediately, Mosimann said. The guard was hospitalized, but the injuries were not considered life-threatening, he added.

Two other hostages were let go after about five hours, and Spanish authorities said there were no more employees inside.

Police sealed off Bern's upscale Kirchenfeld neighborhood, where the consulate and other foreign diplomatic missions are located, police spokeswoman Franziska Frey said.

Federal authorities also sent reinforcements, Federal Police Office spokeswoman Daniele Bersier said.

In Madrid, Spain's foreign ministry called it an attempted robbery.

"Apparently, judging from the information we have received, from the outset the three assailants wanted to get at the safe," Spanish Foreign Ministry spokesman Angel Vazquez told Spanish National Radio.

"This makes one think their goal was money, but this is just speculation," he said. "It will take some time for us to establish with certainty the exact nature of this act."

There have been a handful of previous security crises at foreign embassies and consulates in Switzerland, notably in 1999.

In February 1999, members of Switzerland's Kurdish community staged a daylong, peaceful occupation of the Greek Embassy in Bern, as well as the Greek consulate in Zurich and United Nations offices in Geneva. They were protesting Greece's help in the capture of Kurdish rebel leader Abdullah Ocalan (search) and his handover to Turkey.