After months of unexplained delays, Acting Defense Secretary Patrick Shanahan stepped down Tuesday before his formal nomination ever went to the Senate, citing a "painful" family situation that would hurt his children and reopen "wounds we have worked years to heal."

President Donald Trump announced Shanahan's departure in a tweet, and said that Army Secretary Mark Esper would be the new acting Pentagon chief.

"I believe my continuing in the confirmation process would force my three children to relive a traumatic chapter in our family's life and reopen wounds we have worked years to heal," Shanahan said in a statement. "Ultimately, their safety and well-being is my highest priority."

The acting defense secretary did not provide specifics about the family situation. But The Washington Post published an interview with Shanahan on Tuesday, shortly before Trump tweeted that his nomination would not go forward. In the interview, Shanahan spoke about the circumstances surrounding his 2011 divorce and said he didn't want to drag his children through the experience again.

"Bad things can happen to good families ... and this is a tragedy, really," Shanahan told the Post.

In his statement, Shanahan said he asked to be withdrawn from the nomination process and he resigned from his previous post as deputy defense secretary. He said he would work on an "appropriate transition" but it wasn't clear how quickly he will leave the job.

Defense officials said that leaders are trying to decide when Esper would take over the job. Officials were meeting Tuesday afternoon to discuss transition plans. The officials spoke on condition of anonymity because they weren't authorized to publicly discuss internal deliberations.

In his tweet, Trump simply said that Shanahan had done "a wonderful job" but would step aside to "devote more time to his family."

And, in noting Esper's move, Trump added, "I know Mark, and have no doubt he will do a fantastic job!"

The post atop the Pentagon has not been filled permanently since Gen. James Mattis retired in January following policy differences with Trump.

Trump announced in May that he would nominate Shanahan but the formal nomination process in the Senate had been inexplicably delayed.

Shanahan, a former Boeing executive, has been leading the Pentagon as acting secretary since Jan. 1, a highly unusual arrangement for arguably the most sensitive Cabinet position.

His prospects for confirmation have been spotty due in large part to questions about his lengthy work as former Boeing executive and persistent questions about possible conflicts of interest.

The Defense Department's Inspector General cleared Shanahan of any wrongdoing in connection with accusations he had shown favoritism toward Boeing during his time as deputy defense secretary, while disparaging Boeing competitors.

In Shanahan's tenure at the department he's had to deal with a wide array of international hotspots, ranging from missile launches by North Korea to the sudden shift of military ships and aircraft to the Middle East to deal with potential threats from Iran.

Shanahan, 56, had extensive experience in the defense industry but little in government. In more than four months as the acting secretary, he focused on implementing the national defense strategy that was developed during Mattis' tenure and emphasizes a shift from the resources and tactics required to fight small wars against extremist groups to what Shanahan calls "great power" competition with China and Russia.