A Long Island man tripped over a telephone cord during an audit, sued the IRS and came away $862,000 richer — and he doesn’t have to pay any taxes on the windfall, The Post has learned.

William Berroyer, 66, the father of a Suffolk County cop, claimed he could no longer enjoy activities from golf to sex because of injuries suffered when the cord wrapped around his leg in a Haup­pauge IRS office in 2008.

The IRS argued that Berroyer, of Nesconset, was exaggerating his injuries, but Judge Arthur Spatt found the agency liable for pain and suffering, court papers show.

The former businessman was hammering out a repayment deal with the IRS for his $60,000 bill when he was injured.

He testified that both he and the auditor — Richard Enterlin — were “shocked” by his tumble.

“I really can’t say whether I hit it with my shoulder, hand or elbow, but I broke my fall on the cabinet,” Berroyer testified.

He left the office on his own power but called Enterlin from the parking lot to tell him he had lost the feeling in his lower leg and had shoulder pain, according to court papers.

He spent the next 17 days in hospitals and rehab clinics to deal with the agony, Berroyer testified.

‘I was frightened,” he said in court. “I had gone from everything to nothing, and I was frightened.”

Berroyer claimed he and his wife had sex several times a week before the injury, but could manage only a single monthly session after the accident.

IRS attorneys accepted that he fell because of the wayward wire — but argued that Berroyer was grossly exaggerating his injuries to score a payday.

They even dispatched a surveillance crew to his house to catch him doing something rigorous to prove their point, according to the court records.

Testifying for the IRS, Dr. Arthur Rosen said, “There is no physical basis for the defect that the patient claims.”

Despite the award, it could have been worse for Uncle Sam.

Berroyer was seeking $10 million in the lawsuit and claimed that he had been wheelchair-bound ever since the injury.

But Judge Spatt didn’t buy that claim, and limited the amount of the payout.

Neither Berroyer nor his attorney, Alison Metzler, returned calls for comment.