A nearly six-hour standoff at the San Diego FBI headquarters in Sorrento Valley has ended.

The suspect, who had refused to come down from the roof of an annex building, was taken into custody shortly after 5 p.m. on Sunday.

The man has been identified as William Durant, 36, of Lakeside.

According to FBI Special Agent Darrell Foxworth, Durant broke into the gated facility by climbing over a steel security fence, injuring himself in the process.

When the suspect couldn't get into the main building, Foxworth said he made his way to the top of the parking garage and then onto to the roof of a single-story annex building.

"When he did make entry into the building, one of our security officers tried to stop him. In the course of doing so, the man indicated he had a weapon," Foxworth said. "I'm told a weapon has not been seen, but he did tell the officer he was armed with a weapon."

Officials said Durant was in possession of a broken metal door handle.

Durant called NBC 7 from the rooftop during the ordeal. He voiced concerns for his safety and asked for help, but would not give his name at that time or details into why he was doing this.

During the standoff, Durant alternated between sitting on a ledge and roaming around the roof. Two loud flashbangs were heard before he was taken into custody.

The incident started just after 11:30 a.m. Sunday. FBI hostage negotiators, an FBI SWAT team, SDPD officers and fire-rescue crews responded to the incident.

Durant will face federal charges.

Check back for updates on this developing story.