Image caption Emergency vehicles could be seen swarming around the courthouse

Two women have been killed in a shoot-out that also left a gunman dead and two police officers wounded at a courthouse in the US state of Delaware, police have said.

Officers exchanged fire with the armed man in the lobby of the courthouse in Wilmington after he began shooting.

The city's mayor said one victim was the attacker's estranged wife.

Delaware Attorney General Beau Biden said that the shooting was the result of a custody dispute.

"It's developed out of a long - over the course of many years - custody dispute in the courts of this state,'' he said at an afternoon press conference.

Police did not say if the two women were killed by the shooter or in a cross-fire with police. Nor is it clear how the gunman died.

Two police officers are expected to survive their injuries, said Delaware State Police Sgt Paul Shavack.

"It happened so fast,'' said Jose Beltran, an employee at the New Castle County Courthouse.

Mr Beltran was entering the lobby of the courthouse shortly after 08:00 local time (13:00 GMT) when he heard two shots. He said he heard at least three more shots as he ran.

Chick Chinski told the Associated Press news agency it seemed that the shooter aimed at the two women as they stood in the middle of the lobby.

"It didn't sound like gunfire first at all,'' Mr Chinski said.

Sgt Shavack said the gunman opened fire before passing through lobby metal detectors.

Dozens of police cars and emergency vehicles surrounded the courthouse, which was evacuated after Monday morning's incident. Police searched the courthouse room by room as a precaution.

Court officials said the building would be closed on Tuesday for investigation and repairs.

"The violence today has saddened and horrified all of us,'' Delaware Chief Justice Myron Steele said.

"I know I can speak for our entire judiciary in thanking the capitol police for risking their lives to protect as many of our citizens and employees as they could.''