A helicopter pilot who had an affair with the wife of a Special Forces soldier fighting in Afghanistan and who harassed her after she broke off the relationship says his dismissal from the Army was too harsh a punishment.

Maj. Jason A. Scott, who pleaded guilty at his court-martial to conduct unbecoming an officer and failure to obey an order, is asking the military's highest court to overturn the sentence.

After serving for more than 20 years, including combat missions in Iraq, he argued he is entitled to a pension and other retirement benefits, which he said he would have received if not for his incompetent military defense lawyers.

The Court of Appeals for the Armed Forces this month agreed to review the case.

Scott, an Apache helicopter pilot, met the woman -- the wife of a deployed sergeant first class assigned to the 19th Special Forces Group -- in May 2015 at a spin class she was teaching at Joint Base Lewis-McChord. The two soon began dating, according to court documents.

Unaware for some weeks that she was married, Scott introduced the woman as his girlfriend to co-workers. By October, the command had learned the woman was married and Scott's supervisor, a colonel, ordered an end to the romance. Scott did not comply.

After the sergeant's wife ended the relationship in January, Scott began harassing her by text message, alternately threatening her, demanding sex and professing his love, court documents say.

In one message, Scott sent the woman a link to a news story about a Special Forces soldier who had been killed in Afghanistan, and asked if her husband was dead.

When she responded that his unit was surrounded and that members of the unit had been killed, Scott "suggested that she might get lucky if (her husband) were to be killed in action," according to the Army Court of Criminal Appeals case summary. He also told her, "No man wants a whore for a wife."

After he returned from deployment, the sergeant first class spoke at Scott's court-martial. He said that learning about the affair and Scott having "joked" about his death had altered his view of officers.

The Army Court of Criminal Appeals, which heard the case last year, said Scott's dismissal was appropriate.

"One must think hard to conjure a worse case of adultery than when a field grade officer knowingly has a long-term sexual relationship with the spouse of an enlisted soldier who is deployed in combat, and then egregiously disobeys direct orders to end the relationship," the court said.

But the court also said Scott's lawyers' handling of the case might entitle him to a new sentencing hearing.

It agreed with the lawyers' own assessments that they'd been ineffective in Scott's defense, in part because they had not anticipated or prepared for the sentence they called "ludicrous" and "unconscionable."

"That a dismissal was a plausible sentence should have been obvious," the Army court said.

The lawyers also failed to sufficiently detail Scott's decades of service or present two witnesses -- the former battalion commander under whom Scott served a 15-month Iraq deployment and a chief warrant officer -- who both described Scott as a fearless warrior.

Instead, the defense called as a witness the colonel whose order Scott disobeyed, and who told prosecutors under cross-examination that Scott's conduct "was so detrimental to good order and discipline that it needed to be snuffed out immediately."

Read more: Navy Not Doing Enough to Evaluate Training Changes After Deadly Collisions: GAO