Being the leader of the free world is an expensive proposition. And the costs don’t stop once you leave the White House.

The government spent nearly $3.7 million on former presidents in 2012, according to an analysis released by the nonpartisan Congressional Research Service. That covers a pension, compensation and benefits for office staffers, and other costs.

The costliest former president? George W. Bush, who clocked in last year at just more than $1.3 million.

The $3.7 million taxpayers shelled out in 2012 is about $200,000 less than in 2011. All of it is a drop in the bucket compared with the trillions the federal government spends each year.

Still, former presidents are able to command eyepopping sums for books, speaking engagements and the like in their post-White House years, and the report comes at a time when spending cuts and the deficit are forcing lawmakers and federal agencies to cut back.

Under the Former Presidents Act, previous inhabitants of the Oval Office are given a $200,000 annual pension — the equivalent to a Cabinet secretary’s salary — plus $96,000 a year for a small office staff. The government also picks up the tab for costs such as travel, office space and postage.

Departing presidents get additional help in the first years after they leave office, one reason Bush’s costs were higher than those of other living former presidents. The most recent president to leave the White House, Bush was granted almost $400,000 for 8,000 square feet of office space in Dallas, plus $85,000 in telephone costs. Another $60,000 went to travel costs.

Bill Clinton came in second at just less than $1 million, followed by George H.W. Bush at nearly $850,000. Clinton spent the most government money on office space: $442,000 for his 8,300-square-foot digs in Harlem.

Costs for Jimmy Carter, the only other living former president, came in at about $500,000.

Widows of former presidents are entitled to a pension of $20,000, but Nancy Reagan, the wife of former president Ronald Reagan, waived her pension last year. The former first lady did accept $14,000 for postage.

The cost totals for former presidents do not include what the Secret Service spends protecting them, their spouses and children. Those costs are part of a separate budget that is not made public.

The Former Presidents Act dates to 1958, when Congress created the program largely in response to Harry S. Truman’s post-White House financial woes, the Congressional Research Service said. The goal was to maintain the dignity of the presidency and help with ongoing costs associated with being a former president, such as correspondence and scheduling requests.

These days, a former president’s income can be substantial from speaking and writing, and former presidents also have robust presidential centers and foundations that accept donations and facilitate many of their post-presidential activities.

Noting that none of the living ex-presidents are poor, Rep. Jason Chaffetz (R-Utah), introduced a bill last year that would limit costs to a $200,000 pension, plus another $200,000 that former presidents could use at their discretion. And for every dollar former presidents earn in excess of $400,000, their annual allowance would be reduced by the same amount.

The bill died in committee.

— Associated Press