The Paris prosecutor's office detained the suspect, a 26-year-old man born in Morocco, a judicial official said. It was not immediately clear if he had French nationality.
The man is being investigated on multiple counts, including kidnapping and sequestration, attempted homicide and violence with a weapon, the official said. The official was not authorized to discuss an ongoing investigation and asked not to be named.
Two hostages were freed, one who reportedly had been doused with gasoline and threatened by the hostage-taker with being set on fire, French TV news stations BFM-TV and CNews reported.
Authorities provided no details of the raid by specially trained intervention police officers four hours after the hostage-taking began at about 4 p.m.
Before the arrest, police and firefighters sent a water-spraying robot into the building, Le Parisien newspaper reported.
Dozens of officers in riot gear, firefighters and rescue workers had evacuated and blocked off the Rue des Petites Ecuries while negotiations took place. The hostages were held in a ground-floor office in a crowded neighborhood. Their captor apparently was armed with knives.
As negotiations progressed, the hostage-taker reportedly asked to speak to the Iranian ambassador, a police union official, Yves Lefebvre, said. However, a motive for the demand was not established.
Iran's semi-official ISNA news agency reported that a spokesman for Iran's Foreign Ministry, Bahram Ghasemi, said the Iranian Embassy in Paris stood ready to help "considering the importance of people's lives and human aspects of the issue."
During the negotiations, the hostage-taker reportedly evoked a strange mix of events, from the Sept.ember 11 attack on the World Trade Center to the kidnapping and death last year of a young girl in an Alpine town.
The hostage-taker also claimed he had an accomplice outside the building with a bomb, according to union official Lefebvre. Police swept vehicles in the area with a device but found nothing, he said.
Before officers moved in, Lefebvre said a third hostage had been freed. That hostage was also reportedly doused with gasoline and hit in the face, he said. Paris police have not revealed how many people were taken, hostage.