TACOMA — The state Court of Appeals has upheld Scott L. Davis’ 25-year conviction of first-degree assault and first-degree attempted murder in connection with a 2009 gunfight with Clallam County Sheriff’s Deputy Bill Cortani at a cabin in the West End.

The 3-0 Division 2 appeals court decision was issued Tuesday.

A county Superior Court jury convicted the Silverdale resident and 20-year Army veteran July 30, 2010, of the charges after the Jan. 19, 2009, gunbattle at a vacant state cabin on state Highway 112 near Neah Bay where Cortani had gone to investigate a report of trespassing.

When the shooting stopped, Cortani, injured in the left arm and hip, and Davis, shot in the stomach and left arm, were airlifted to Harborview Medical Center in Seattle, where they were treated and discharged.

Davis, 63, had pleaded guilty by reason of insanity.

He had a history of mental-illness symptoms before suffering a “psychotic break” in 2005, according to the facts of the case as outlined in the appeals court decision, written by Chief Judge Lisa R. Worswick and concurred by Presiding Chief Judge Christine Quinn-Brintnall and Judge Marywave Van Deren.

In 2008, Davis, a former Eagle Scout, stopped taking his medications.

When he stopped taking the medications, Davis began suffering delusions, “including that society would collapse and people would turn to cannibalism” and “building a tent city in a national forest” in anticipation of that collapse, according to the opinion.

The facts according to court documents are:

When Cortani arrived at the cabin the day after Davis occupied it, Davis refused Cortani’s request for identification.

Cortani fired his stun gun, which was ineffective, and Davis responded by reaching inside his coat and firing a handgun at Cortani, hitting him in the arm while the two were on the cabin’s deck.

Cortani returned fire and ran down to the beach, where Davis shot him a second time, this time in the hip, as Cortani ran for cover behind a log.

Davis stopped shooting, went into the cabin, came out carrying a shotgun and moved toward Cortani, who fired at Davis as Davis raised the firearm in Cortani’s direction.

The firefight stopped after Davis tossed away the shotgun and said he needed help.

Davis, who is incarcerated at the Washington State Penitentiary at Walla Walla, was transferred there from the Washington Corrections Center in Shelton in February 2012, state Department of Corrections spokesman Chad Lewis said Wednesday.

Davis’ earliest release date is October 2032, when he will be 83, Lewis said.

Davis’ appeal included the contention that he received ineffective representation from Port Angeles lawyer Harry Gasnick of Clallam Public Defender because of Gasnick’s “failure to introduce available evidence of [Davis’] good character,” according to the opinion, which rejected the claim.

Gasnick’s witnesses included Davis’ sister, who called her brother “a family man” and Davis’ cousin, who testified that Davis at one time was friendly, outgoing and happy but became irritable after his mental status deteriorated, according to the opinion.

Gasnick said Wednesday that he had wanted Davis to win the appeal.

“It’s not a matter of me feeling exonerated or not exonerated,” Gasnick said.

“When you take a case to trial and do not prevail, how you handle that case will invariably be second-guessed.

“That’s how it should be.

“That’s how it ensures people will do a good job at trial.”

Davis’ appeal also included the contention, which the court rejected, that his right to be free of double jeopardy was violated. The appeal claimed he was convicted twice for the same offense.

The court ruled that the assault occurred on the cabin’s deck when Davis fired at Cortani with a handgun.

The attempted murder occurred when Davis obtained the shotgun from inside the residence and on the beach, “where Davis advanced toward Deputy Cortani to carry out his plan,” according to the appeals court decision.

“According to a volunteer emergency medical technician, Davis said something to the effect that he would have killed Deputy Cortani if his pistol had not jammed or run out of ammunition,” Worswick said in the opinion.

As a result of his actions, Cortani, who was 42 when Davis was tried, received numerous accolades, including the Law Enforcement Medal of Honor, the state’s highest law enforcement award.