The announcements are formally expected Thursday. Both positions require Congressional approval, but are unlikely to run into much difficulty.

After weeks of discussions, President Obama formally asked Panetta to serve as Secretary of Defense on Monday. Panetta, who was reluctant to change jobs, got back to him on Tuesday and told him he'd do it.

Panetta, a former Congressman and Chief of Staff to President Bill Clinton, is well liked on Capitol Hill. Petraeus has commanded American forces in both Iraq and Afghanistan during key transitional periods.

If all goes according to plan, according to Pentagon sources, Panetta could be installed at the Pentagon by the end of the summer. Current Defense Secretary Robert Gates, who has served under both President Bush and President Obama, has long made clear he wants to leave the demanding job.

A senior defense official said that Gates recommended that Panetta replace him six months ago and Gates joked that Panetta wouldn't talk to him for several days after he made the recommendation. So Panetta is Gates's number one choice. Gates is epxected to leave the Pentagon June 30th. Petraeus will not leave Afghanistan until early fall, so there will likely be an interim CIA director.

The staffing changes will come at a pivotal time for the war in Afghanistan, where Petraeus is supposed to start withdrawing troops this summer if he is to stick with the timeline laid out by President Obama.

The plan is for the U.S. to begin pulling its combat troops out of Afghanistan in July, but there has still been no recommendation made by Gen. Petraeus about how many troops should come home.

"I have not yet received General Petraeus' recommendations," Gates said Tuesday.

Defense officials say there has been no presentation of numbers from Afghanistan to the Pentagon. What is known is what President Obama told the AP two weeks ago: "I'm confident that the withdrawal will be significant. People will say this is a real process of transition; this is not just a token gesture."

Typically, the military likes personnel decisions to be made with enough time to prepare or stand down troops for deployment, but in this case, it could come very late in the process. Petraeus wants to keep his current force level of 100,000 U.S. troops for as long as he can to fight off the Taliban when Afghanistan's fighting season is in full gear in a few weeks.

It's the middle of the poppy harvest in Afghanistan right now, a time when young men work in the fields, and afterwards it has become typical for them to hire themselves out to the Taliban for the fighting season. That could mean fighting intensifies around July, the same time the administration is deciding how many troops to pull out.

Replacing Petraeus in Afghanistan will likely be Marine Gen. John Allen. In addition, Joint Chiefs Chairman Mike Mullen is expected to leave his post in October. Vice Chairman James Cartwright remains the frontrunner to succeed Mullen; others in contention include Adm. James Stavridis, who commands U.S. forces in Europe, and Army Chief of Staff Gen. Martin Dempsey.

Replacing Petraeus in Afghanistan will likely be Marine Gen. John Allen. In addition, Joint Chiefs Chairman Mike Mullen is expected to leave his post in October. Vice Chairman James Cartwright remains the frontrunner to succeed Mullen; others in contention include Adm. James Stavridis, who commands U.S. forces in Europe, and Army Chief of Staff Gen. Martin Dempsey.

Gen. Ray Odierno, who succeeded Petraeus as the top commander in Iraq in 2008 and served there until 2010 is the frontrunner to be Vice-Chairman of the Joint Chiefs. He is currently the commander of U.S. Joint Forces Command.

Finally, former U.S. Ambassador to Iraq Ryan Crocker will replace outgoing U.S. Ambassador to Afghanistan Karl Eikenberry. Crocker is also a former U.S. Ambassador to Pakistan and knows the region well.

Leon Panetta to Secretary of Defense, David Petraeus to CIA, Say Sources

Not everyone is happy about the changes. A former top intelligence official -- a high-profile figure in the intelligence world -- tells ABC's Jonathan Karl that David Petraeus is an "awful" choice for Director of the Central Intelligence Agency because he won't fit in with the culture at CIA.

The moves of Panetta and Petraeus have been rumored for months, but only recently took shape. And the moves would have seemed fantastic not so long ago. Former President Bush, interviewed this morning on "Good Morning America", asked if it was no more than gossip.