(CNN) Kevin Sweeney has resigned as Pentagon chief of staff after serving the defense secretary for two years.

"I've decided the time is right to return to the private sector. It has been an honor to serve again alongside the men and women of the Department of Defense," Sweeney said in a short statement posted on the Department of Defense website late Saturday night.

A knowledgeable source told CNN's Jake Tapper that the White House forced Sweeney out. The source did not provide further information about the reason.

Kevin Sweeney is seen in 2014 when he served as a US Navy rear admiral.

On Sunday, acting Defense Secretary Patrick Shanahan praised Sweeney in a pair of tweets, writing that "we're going to miss him here at the Pentagon."

"I greatly appreciate Kevin Sweeney's service to our nation, first as a Navy officer of more than 30 years, and then as the Chief of Staff for the Secretary of Defense for the past two years," Shanahan wrote in a tweet.

Read More