BANGOR, Maine — Bradford resident Peter Robinson took the stand at his murder trial on Thursday and told the jury he used a crowbar to beat Hudson resident David P. Trask to death because he thought Trask had a gun.

Robinson, 49, said he confronted Trask, 71, on Nov. 12, 2011, about him leaving a chained gate open that gave access to the road to their properties. He testified earlier in the day to years of harassment by Trask family members over hunting on his posted land and disputes over the right of way.

“I told him, ‘We need you to put the gate up, Dave,’” Robinson testified, recalling the day he took Trask’s life 16 months ago.

He demonstrated the moves he made, using his defense attorney Thomas Hallett as a stand-in for David Trask. He said Trask had the crowbar in his hands and attempted to hit him with it, which is when he took the 15-pound, 58-inch-long metal bar out of Trask’s hands.

“I reached out and grabbed it like this,” he said in the courtroom taking a wooden pointer from his lawyer’s hands. “He went to grab me [and] I hit him twice,” Robinson said, using the pointer to poke his attorney in the side, an action which in reality broke half a dozen of Trask’s ribs, according to testimony earlier in the week from the medical examiner.

“He said, ‘I’m going to kill you, you [expletives],’” Robinson said, recalling Trask’s last words.

Trask took off a glove and reached for what Robinson said he thought was a holster.

“I struck him on the side of the chin area [with the crowbar],” the defendant said.

The impact knocked Trask to the ground. The holster turned out to be a cellphone.

“He goes down and I see him going for his holster,” Robinson said. “I did one final blow because I thought he was going to shoot me.”

Robinson’s attorney asked him if he could have run away.

“No. All I could picture was him pulling a gun and shooting me,” Robinson answered.

The four hits took just seconds, the defendant said.

“I saw the damage I had done. It was awful and I went into a state of shock,” Robinson said. He said he then turned back toward his house, picked up a hammer from off the ground and threw it into the back of Trask’s truck. Once inside his home, “I dropped to my knees and started to cry,” he said.

In the recording of the 911 call Robinson made played in court, he didn’t mention a gun.

“He came at me with a crowbar and I struck him in the head and I think he’s dead,” Robinson said to the 911 dispatcher. “This guy has been harassing me for years. I just wanted to tell him to shut the gate and he came at me with a crowbar.

“We had a confrontation and he had a crowbar and I took it from him and bumped him,” he said later in the recording, his voice breaking with emotion.

The dispatcher was heard speaking with Robinson’s wife, Cheryl, for a few moments. Robinson could be heard crying in the background. At the end of the call for help, Robinson got back on the phone and told the dispatcher that he and his wife would stay in the house.

“We’re here. We’re friendly. Tell them to just come in. We’ll just be sitting here,” he said on the recording.

Trask’s family and friends filled the entire right side of the courtroom at the Penobscot Judicial Center. At points during the trial, including when Assistant Attorney General Andrew Benson presented a photo of Trask’s body lying on the ground with obvious and bloody injuries to the head, his son David A. Trask could be seen fighting back his own tears as he supported his quietly crying sisters by rubbing their shoulders.

Robinson was the first person to testify for the defense in the trial, which is expected to last until early next week.

Robinson’s trial began Monday and has included testimony about a plot by Trask’s son to harm the defendant, a murder-for-hire plot after Robinson got to jail, a video recorded by Robinson showing a confrontation with the Trask family in 2011, a former game warden’s testimony that Robinson made threats against the Trask family in February 2009, and testimony by neighbors about the strife between Robinson and the Trasks.

The state rested its case Thursday morning after calling a DNA expert and Maine State Police detective to the stand.

Theresa Calicchio, a forensic expert at the Maine Crimes Lab, said blood found on Trask and items in his pocket that spilled out near his body, and on boots and pants found at Robinson’s home, matched Trask’s blood.

Detective Herbert Leighton, who works with the Maine State Police major crimes unit, testified that blood splatter on Trask and other evidence indicated he was on the ground when he was killed.

Robinson took the stand about 12:30 p.m. and remained there until about 4:25 p.m. He was given two short breaks during his testimony after he said he was “stressed out” and needed a few minutes to regain his composure.

Benson started grilling Robinson about his account of the event about 3:10 p.m., asking him question after question about why he confronted Trask if he was afraid and intimidated by him and his family, as he had earlier testified.

Robinson needed his second stress break when Benson questioned him about escalating the situation by walking the 400 feet from his home to where Trask was working on a road culvert to confront him on the day he died.

“Yes, I did. I am very stressed and I’m having a hard time,” Robinson said.

Benson then recalled the sworn testimony of the game warden, his neighbors and Trask family members who already had taken the stand and asked Robinson individual questions if he thought they each lied.

“He’s not telling the truth.”

“I don’t recall saying that.”

“I never said that, sir,” were Robinson’s answers.

“Are they all mistaken?” the prosecutor asked.

“I guess you can say that,” Robinson said.

Earlier courtroom action centered on the alleged murder-for-hire plot against Robinson.

Hallett has stated in at least one court document that two of the victim’s brothers and one of their wives hatched a murder-for-hire plot in 2012, after Robinson was arrested.

Attorneys Michael Rair and Hunter Tzovarras, who are representing the two brothers, told Justice William Anderson on Thursday morning that if their clients were called as witnesses, they would invoke their Fifth Amendment right against self-incrimination and refuse to answer questions.

Hallett asked that they be allowed to testify about the prior relationship between themselves and their family members and Robinson, with the caveat that they not discuss the murder-for-hire plot.

To prove that Robinson acted in self-defense, Hallett must show that his client reasonably believed deadly force was necessary and reasonably believed Trask was about to use unlawful deadly force against him, he argued Thursday morning in opposition to the motions to quash the subpoenas.

Anderson said before the jury was called in Thursday morning that he would decide after lunch if the defense would be able to call the brothers, but said, “they can’t testify piecemeal,” which means if they take the stand, they could be asked questions about the murder-for-hire plot.

“I can’t let my guy get on the stand. If he does, his constitutional rights are gone,” said Rair during the lunch break.

Anderson did not rule on the issue during the afternoon session. He is expected to rule on it Friday, according to the attorneys.

The trial is expected to resume at 9:30 a.m. Friday.