Heavily armed police enter the New Castle County Courthouse, Monday morning, Feb. 11, 2013 in Wilmington, Del. The mayor of Wilmington, Del., says a man suspected of killing his wife and wounding two others at the New Castle County Courthouse has been killed by police. Law enforcement officials and investigators gather outside the New Castle County Courthouse in Wilmington, Del. on Monday, Feb. 11, 2013, after three people died Monday morning in a shooting at a courthouse, including the shooter, authorities said. AP Photo/ Joseph Kaczmarek Police cars fill the street outside the New Castle County Courthouse, Monday morning, Feb. 11, 2013 in WiIlmington, Del. , after a man killed his estranged wife and two others at the courthouse. The mayor of Wilmington says police have killed the gunman. Police confer outside the New Castle County Courthouse, Monday morning, Feb. 11, 2013, in Wilmington, Del. , after a man killed his estranged wife and two others at the courthouse. Police stand outside the New Castle County Courthouse, Monday morning, Feb. 11, 2013 in WIlmington, Del. , after a man killed his estranged wife and two others at teh courthouse. The mayofro f Wilmington says police have killed the gunman. (AP) - Motivated by a yearslong custody dispute, a gunman opened fire Monday morning in a Delaware courthouse lobby just as the building was opening to the public for the day, exchanging shots with police and leaving three people - including the shooter - dead, authorities said. "It happened so fast," said Jose Beltran, 53, an employee at the New Castle County Courthouse who was entering the lobby when he heard two shots. He said he turned around and heard three or more shots as he ran. Delaware State Police Sgt. Paul Shavack said the suspected gunman and two women are dead. Wilmington Mayor Dennis Williams said in a phone interview that one of the women killed was the shooter's estranged wife, but Shavack said police had not confirmed that was the case and cautioned against information from other sources. Shavack said did not say how the gunman died. He said two police officers suffered non-life-threatening injuries. Delaware Attorney General Beau Biden said at an afternoon news conference that the shooting was not a random act of violence but 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. Earlier, Shavak said the gunman opened fire before he passed metal detectors in the lobby. Chick Chinski, 62, of Middletown said he was entering the courthouse to report for jury duty when he heard popping sounds. "It didn't sound like gunfire first at all," said Chinski, adding that he saw the gunman pointing his weapon. He said it seemed that the shooter deliberately targeted the two women who were shot as they stood in the middle of the lobby. "Absolutely," he said. It's right what he went after when he come in the door. That's exactly what he did instantly. Chinski said that earlier, he shared an elevator with the gunman and others from the parking garage. The gunman was quiet and did not appear agitated, Chinski said. In the hours after the shooting, dozens of police cars and emergency vehicles were on the streets surrounding the courthouse. Police searched the courthouse room by room as a precaution. Dick Lawyer works part time across the street at the law office of Casarino, Christman, Shalk, Ransom & Doss and said his office building was on lockdown for a few hours, starting about 8:15 a.m. The shooting occurred about five minutes earlier. He said he and colleagues were shaken at first but calmer hours later. "We have a couple of people whose relatives work at the courthouse," said Lawyer, who works as a document management specialist for the firm. He said the parking garage in the basement of the building - called the Renaissance Center - was still on lockdown as of 3:20 p.m. Robert Vess, 68, dropped off his wife, Dorothy, 69, for jury duty at the courthouse Monday morning. He said it wasn't until after 10:30 a.m. that she was able to call him and let him know she was safe. Vess said his wife, who works as a baker at a grocery store, was crying when she called, but he thought she would be all right. "She had said, 'If I had my way, I'd do jury duty every day,' but I don't think so after this," Vess said. A news release from the state court administrator said the county courthouse would be closed Tuesday for the investigation and repairs. "The violence today has saddened and horrified all of us," Delaware Chief Justice Myron T. Steele said in the statement. 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. Associated Press writers Maryclaire Dale in Wilmington and Jessica Gresko in Washington, D.C., contributed to this report.