WINSLOW — A five-hour armed standoff with local and state police ended today with no injuries and a man in custody.

William M. Dolley, 39, of 167 North Pond Road, was arrested outside his mobile home on a charge of terrorizing after threatening to shoot police, they said.

North Pond Road was cordoned off for much of the day as about 20 state police surrounded the home. Dolley eventually gave himself up after walking outside late Thursday afternoon, police said.

“I thought it went very well — the cooperation between Winslow police and state police,” said Winslow Police Chief Jeffrey Fenlason. “We worked together and it came out the way we wanted to: without incident and nobody was hurt.”

Fenlason said Dolley and his wife reportedly had a heated argument Wednesday night and sometime during the morning Dolley demanded his wife leave. She did, taking their two small daughters, Fenlason said.

The woman called police and the call was apparently first transferred by mistake to Winthrop police, which then sent the call to Winslow at 9:55 a.m., Fenlason said.

“He called her on a cell phone — somehow he found out the police had been called; I don’t know if she told him directly — and he said, ‘You made a very big mistake by getting the police involved.’ He said, ‘I see anyone here, I’m going to shoot them, cops included,’” Fenlason said. “He said he would kill the first officer — any officer — he saw.”

Winslow officers got there about 10:30 a.m., evacuated neighbors from their homes, and notified Maine State Police eight minutes later. A state police tactical team arrived, wearing camouflage and armed with assault rifles, a tracking dog and a crisis negotiator.

Dolley at some point during the morning fired a single shot, Fenlason said, though it wasn’t clear later what gun he used or where the shot was fired.

The tactical team approached the mobile home in an armored vehicle and used a megaphone to try to coax Dolley out, but he wouldn’t respond and refused to answer his phone. He blasted loud music as well, Fenlason said.

At one point, Dolley walked out the front door and gave the tactical team two middle fingers and went back inside, “so they became more concerned he was going to go for a weapon.”

Just before 3 p.m., Dolley walked out his back door and headed toward the woods, where he had a tent set up among trails. State police followed him and repeatedly shouted at him to stop. Dolley, who was not armed, finally gave up, though he was still angry and maintained to police that he didn’t do anything, Fenlason said.

“That was our goal, to talk him out,” he said.

Crisis and counseling officials later arrived to speak with Dolley’s wife and daughters, Fenlason said.

Police later seized seven guns from the mobile home — five rifles and two handguns. Dolley is scheduled to appear in court Sept. 20.

According to Morning Sentinel archives, Dolley wrote a letter to the editor published in the Sentinel on March 22, 2009, in which he said it was his “first attempt to articulate how angry I am with the powers that be.”

“I focus my anger on those economic and political leaders who have betrayed us: Madoff and the SEC; AID executives; Bill Richardson; Tom Daschle; Rush Limbaugh. They are all of the same mind, thinking, ‘I am rich, I have influence, I can do whatever I want.’”

“Stockpile food, cash, guns,” Dolley wrote in the letter. “Rich versus poor is our next civil war.”