A Prince George's County Police detective on his way home from work prevented a beating from getting much worse, police said.

Det. Mike Ebaugh, and eight-year-veteran of the force, was leaving police headquarters in Palmer Park at about 10:30 p.m. Saturday when he heard what he called "a wail for help," police said. Ebaugh rolled down the windows to see if he could follow the noise.

When Ebaugh approached the corner of Allendale Drive and Barlow Road, he heard the sound of metal hitting an object. He turned to see a man use a shovel to strike a nearly lifeless man in the head.

Just as the man raised the shovel to strike again, Ebaugh drew his handgun and ordered the suspect to stop. The suspect complied and surrendered.

Arrested was David Eugene Hamilton, 48, of the 2000 block of Ray Leonard Road in Palmer Park. He was charged with first-degree assault.