As President Obama prepares to tie a bow on U.S. combat operations in Iraq, Congressional Budget Office numbers show that the total cost of the eight-year war was less than the stimulus bill passed by the Democratic-led Congress in 2009.

According to CBO numbers in its Budget and Economic Outlook published this month, the cost of Operation Iraqi Freedom was $709 billion for military and related activities, including training of Iraqi forces and diplomatic operations.

The projected cost of the stimulus, which passed in February 2009, and is expected to have a shelf life of two years, was $862 billion.

The U.S. deficit for fiscal year 2010 is expected to be $1.3 trillion, according to CBO. That compares to a 2007 deficit of $160.7 billion and a 2008 deficit of $458.6 billion, according to data provided by the U.S. Office of Management and Budget.

In 2007 and 2008, the deficit as a percentage of gross domestic product was 1.2 percent and 3.2 percent, respectively.

"Relative to the size of the economy, this year's deficit is expected to be the second largest shortfall in the past 65 years; 9.1 percent of gross domestic product (GDP), exceeded only by last year's deficit of 9.9 percent of GDP," CBO wrote.

The CBO figures show that the most expensive year of the Iraq war was in 2008, the year when the surge proposed by Gen. David Petraeus and approved by President Bush was in full swing and the turning point in the war. The total cost of Iraq operations in 2008 was $140 billion. In 2007, the cost of Iraq operations was $124 billion.

According to an analysis by the American Thinker's Randall Hoven, the cost of the Iraq war from 2003-2008 -- when Bush was in office -- was $20 billion less than the cost of education spending and less than a quarter of the cost of Medicare spending during that same period.