It wasn't the Nat King Cole version of "White Christmas" that the suspect requested, but it worked.

A Pennsylvania man who allegedly fired shots at 11 officers during a 10-hour standoff that began Christmas night finally surrendered Wednesday morning after a SWAT officer sang him the holiday song he wanted to hear, authorities said.

The suspect, identified as Nathaniel R. Lewis, 34, of East Vincent Township, was reportedly stressed by the process of separating from his wife during the holidays, Chester County District Attorney Thomas Hogan said, according to the Philadelphia Inquirer.

"That's a Christmas miracle in our book, all because one negotiator was willing to sing him a Christmas carol," Hogan told Lancaster's WGAL-TV. "[It was a] tremendous job all around."

Around 7:30 p.m. Tuesday, Christmas night, Lewis' sister-in-law checked on him after family members said they had been unable to reach him, the Inquirer reported, but he had barricaded himself inside his home, about 42 miles west of Philadelphia.

Lewis later fired four shots from a rifle, according to an affidavit. Then, Lewis's estranged wife called police for a wellness check at the home, the paper reported.

At 10:30 p.m., the Chester County Regional Emergency Response Team arrived, the report said.

Shortly before 1 a.m. Wednesday, members of the Emergency Response Team heard several gunshots fired from a second-floor window, then a shot from inside the house, authorities said.

Shortly after 6 a.m., Lewis shot at police twice, with officers firing back both times, according to the affidavit. No officers were hurt, the Inquirer reported.

The bullets struck the SWAT team's armored car, another home and a civilian's car, WGAL-TV reported.

Then around 7 a.m. Wednesday, Lewis asked to hear a negotiator sing a Christmas carol, authorities said.

"He requested 'White Christmas,' the Nat King Cole version," Hogan said Thursday.

The negotiator, who has over a decade of SWAT team experience, started singing to him, Hogan said.

Lewis then came out of the house and surrendered, according to the Inquirer.

He was taken into custody and faces 11 charges of attempted homicide of a police officer, the station reported.