A Border Patrol agent planned to kill his estranged wife and her new boyfriend at a home in Escondido, a prosecutor said Wednesday.

A Border Patrol agent planned to kill his estranged wife and her new boyfriend at a home in Escondido but instead carried out a hatchet attack on another couple sleeping in a different bedroom, a prosecutor said Wednesday.

VISTA (CNS) - A Border Patrol agent with SWAT experience tried to carry out a plan to kill his estranged wife with a hatchet, but instead attacked two of her roommates when he went into the wrong bedroom, a prosecutor told a jury Tuesday.

Deputy District Attorney George Loyd said Gamalier Reyes Rivera -- who had experience with a Border Patrol SWAT-like unit -- made a "to-do list" in 2005 detailing how to kill his wife and get away with it.

Four years later in July 2009, Rivera put the plan into motion by breaking into an Escondido home with the intent to kill Erika Von der Hyde, the prosecutor said.

Rivera and Von der Hyde were married in 2002, Loyd said. The defendant joined the Border Patrol in 2003 and the couple had a daughter, the prosecutor said.

In 2005, the couple filed for divorce but reconciled and got remarried in 2007, Loyd said. They filed for divorce again in 2009 and were living apart and dating other people when he tried to kill her, Loyd said.

Loyd, in his closing argument, said Rivera armed himself with two hatchets and took a cab from his home in Imperial Beach to the house in Escondido, where Von der Hyde had just moved in with her new boyfriend and other roommates.

About 1 a.m. on July 9, 2009, Rivera broke into the Escondido residence looking for his estranged wife and her boyfriend, but instead encountered Chris Anguiano and his girlfriend, Samantha Shaffer, who were sleeping in another bedroom, the prosecutor said.

"He (Rivera) went there to be violent," Loyd told the jury.

Rivera hit Anguiano in the neck, face and back, about eight times in all, the prosecutor said.

Anguiano was left blind and with brain damage, and his girlfriend suffered deep cuts to her legs and lost the tip of one of her big toes, according to court testimony.

Loyd said there was proof that Rivera intended to kill both Von der Hyde and her boyfriend because the defendant first attacked a man when he went into the wrong bedroom.

Von der Hyde and her new boyfriend were asleep in another bedroom and awoke to screams, according to court testimony.

"He (Rivera ) hit Chris and he hit Samantha with a hatchet, and he did it on purpose," Loyd said of the defendant.

Loyd said Rivera wasn't being honest when he testified that he went to the home only to scare his estranged wife.

The prosecutor urged jurors to convict Rivera on two counts each of attempted murder, assault with a deadly weapon, torture and aggravated mayhem, and a single count of burglary.

Rivera's attorney, Bob Bernstein, conceded that his client was guilty of assault with a deadly weapon on Anguiano and but said there was no intent to harm Shaffer.

Bernstein, in his closing argument, said Loyd had not proven the attempted murder, torture and mayhem counts.

The defense attorney said there was "zero evidence" that Rivera had any animosity toward Von der Hyde's boyfriend or that he intended to kill him. In fact, when confronted by the boyfriend after attacking Anguiano and Shaffer, Rivera dropped a hatchet and fled before being arrested nearby, Bernstein told the jury.

Bernstein called the 2005 "to-do list" a "fantasy note" that Rivera never acted on.

"He was not there (in Escondido) to kill her," the defense attorney told the jury.

Rivera faces multiple life sentences if convicted, Loyd said.

Jury deliberations began in the courtroom of Vista Judge Runston Maino.