ESCONDIDO, Calif. - A hatchet-wielding man who attacked a couple in bed early Thursday works for the U.S. Border Patrol, police said.

Gamalier Reyes Rivera, 32, of Imperial Beach, is accused of critically injuring a man and wounding the 21-year-old woman he was in bed with at about 1:15 a.m. in home in the 800 block of South Upas Street. Witnesses identified Rivera as the attacker. His estranged wife lives in the house with five others, but she was not injured in the attack, Escondido police Lt. Bob Benton said.

Police found the victims in the bedroom with severe injuries, Benton said. "It is a very gory scene, one of the worst scenes that they have seen in their experience," Benton told Fox 5 News.

The attacker had fled, leaving a hatchet in the living room.

Paramedics took the victims to Palomar Medical Center. The man was taken into surgery in critical condition with wounds to his neck and torso.

The woman was treated for injuries to her legs and released later in the morning.

Minutes after finding the victims, officers spotted Rivera walking, covered in blood, near Ninth Avenue and Pine Street, a few blocks from the crime scene. Benton said. He surrendered peaceably and was taken to the same hospital as the victims for treatment of undisclosed injuries.

Several people were in the home with the victims at the time of the attack but were uninjured, police said The motive for the attack was under investigation.