The city engineer who gunned down 12 people at a municipal building in Virginia Beach told a supervisor that he planned on quitting his job for “personal reasons,” according to his resignation letter released Monday.

The gunman, DeWayne Craddock, 40, submitted the letter Friday — the same day he opened fire at the Virginia Beach Municipal Center.

In an email, Craddock — who had worked at the city’s public utilities department for 15 years — said he would leave his job in two weeks.

“It has been a pleasure to serve the City, but due to personal reasons I must relieve my position,” he wrote.

In a reply, the supervisor, whose name was redacted, confirmed Craddock’s resignation date and wished him well in resolving his issues.

After Craddock thanked the supervisor, the email thread ended, offering scant insight into the gunman’s possible motives.

Virginia Beach City Manager Dave Hansen told reporters Sunday that Craddock had not been forced to resign, nor did he quit because he’d unsuccessfully pursued another job within the department.

At the same news conference, the city's police chief, James Cervera, said that investigators had not yet determined what may have motivated the rampage.

Four people who were wounded in the shooting remained in critical condition Monday, according to Sentara Healthcare.

Eleven of the victims were city employees. Another was a contractor who’d gone to the municipal center seeking a permit.