When the Pentagon decided in 2009 to cut funding for Lockheed Martin’s F-22 Raptor fighter jet — a weapons system with cost overruns in the billions of dollars that has rarely seen combat — the Heritage Foundation fought tooth and nail to restore taxpayer money for the planes.

Heritage depicted its support for the F-22 as a matter of vital national security. But what the public didn’t know is that Lockheed Martin, a corporate donor to the conservative think tank, met with Heritage officials on nearly a monthly basis to discuss the F-22 and other defense industry priorities.

Internal emails leaked online show at least 15 meetings in 2008 and 2009 between officials at Heritage and Lockheed Martin, including one with Bill Inglee, who at the time served as a senior lobbyist at Lockheed Martin.

The emails also suggest that Heritage continued courting Lockheed Martin for donations, listing the company repeatedly in Excel spreadsheets used to collect pledges from past donors. Lockheed Martin gave $40,000 to Heritage in 2008, bringing its total contribution to $341,000, according to those documents.

Heritage provides limited information about its donors to the public. But many were revealed in a cache of Heritage fundraising emails and attachments from 2008 and 2009 that somehow ended up getting posted online early last month. The documents detail how the group raises cash and builds relationships with its extensive donor network. Heritage carefully cultivated wealthy donors and corporate benefactors, maintaining extensive call sheets recording contributor demands and interests.

The F-22, which is optimized for air-to-air combat, had long been criticized for its hefty price tag and for lacking combat use. The plane was projected to take nine years and $12 billion to develop — at a cost of $149 million per plane. But as the Los Angeles Times reported, it actually took 19 years to produce at a cost of $26.3 billion — with an average cost per plane of $412 million. The jet has also faced numerous safety problems, including two fatal crashes and a faulty oxygen supply system.

In 2009, then-Defense Secretary Robert Gates and then-Air Force Secretary Michael Donley forcefully requested that Congress end production of the F-22, capping the program at 187 planes, a shift designed to save the military $13 billion. Military officials called for F-22 money to be diverted to weapons that could be deployed to the wars in Iraq and Afghanistan.

The Pentagon request touched off a fierce, though ultimately fruitless, lobbying battle. Lockheed Martin directed its registered lobbyists to fight back against the cuts in Congress and took out full-page advertisements in D.C. publications. And the Heritage Foundation produced a flurry of reports and media outreach efforts to encourage Congress to overturn the Pentagon’s decision.

Emails show that the Heritage Foundation’s fundraising staff worked closely with Mackenzie Eaglen, a researcher at the think tank who authored several reports calling for restoring F-22 funding. According to Heritage’s internal weekly calendar, Eaglen was scheduled to participate in “a Lockheed Martin think tank delegation to visit their fifth-generation fighter production facilities in Fort Worth, TX” in April 2009.

“I had a very interesting 20 minute conversation this morning with Mackenzie Eaglen about the F-22 and defense spending in general. She gave me the sad update of defense spending on the hill, which provided good context for me to understand our activities during Protect America month,” wrote Jeffrey Trimbath, the assistant director of major gift planning at Heritage. Trimbath’s notes show that Eaglen said that Heritage had attempted to “convince the Congress to fund an Allied Variant of the F-22 so that the production lines stay open while retaining a critical aerospace industrial base,” but that the combined opposition of Secretary Gates and Sen. John McCain, R-Ariz., made the request difficult.

James Jay Carafano, the vice president of Heritage’s Institute for National Security and Foreign Policy, met several times with Lockheed Martin executives, even traveling to Marietta, Georgia, where the F-22 is produced, to participate in a “Lockheed Martin Tour of F-22 Programs.”

Some of the meeting documents list their topics, including one titled “Lockheed Martin Briefing on the Saudi Eastern Fleet Modernization Program.” But the documents do not go into detail about what was discussed at the meetings.

“We have no comment,” said Katherine Trinidad, Lockheed Martin’s director of worldwide media relations, when asked about the company’s relationship with Heritage. Officials at the Heritage Foundation did not respond to a request for comment. Eaglen, who now serves as a fellow with the American Enterprise Institute covering defense policy, did not immediately respond to a request for comment.

Heritage furiously opposed any effort to end production of the F-22. “The ability of America’s Air Force to dominate the skies is under attack from a different kind of enemy: a long-standing and widening fighter aircraft gap, which President Obama’s fiscal year (FY) 2010 defense budget fails to remedy,” claimed one Heritage report that called for restoring funding to the F-22. Another report from Heritage that year asked Congress to purchase 20 additional F-22 planes and to modify the planes for sale to Japan, Australia and “possibly South Korea.”

“Obama Just Made Us More Vulnerable… Again,” said a headline from Heritage’s blog, citing the end of F-22 production — one of several posts that year arguing that the Pentagon decision would threaten national security.

William Hartung, director of the Arms & Security Project at the Center for International Policy, said the documents provide “damning evidence of how hawkish think tanks do the bidding of powerful weapons contractors while posturing as objective national security analysts.”

Trimbath’s fundraising notes mention Heritage’s Protect America Month, an initiative calling for increased defense spending. Fundraising documents show that Northrop Grumman, another major defense contractor, had pledged money to support the initiative.

The fundraising documents list other programs at Heritage that got direct corporate support. IBM and Bayer both pledged money for Heritage’s Index of Freedom, an effort to rank the relative “freedom” of countries based solely on economic policy factors. Protection Life Corp, an Alabama-based insurance company, pledged $10,000 for Heritage’s Health Care Initiative.

Press accounts suggest Google Inc.’s donations to Heritage began in 2010, but the fundraising documents show that the search engine company contributed money in 2009 as well. Heritage would eventually warn regulators not to press the Mountain View, California-based company on alleged antitrust violations.

Corporations frequently donate to think tanks that share their policy agenda. Corinthian Colleges, a chronically underperforming for-profit college that relied on $1.4 billion in yearly loans backed by the federal government, funded Beltway think tanks such as the American Enterprise Institute that helped oppose regulations on the company and other failing proprietary colleges. Alpha Natural Resources, a coal mining company, financed think tanks and political operatives working to counter the belief in man-made global warming. Donations from both companies were made public this year only after the firms declared bankruptcy.

Defense contractors are no different, and have historically played an outsized role in shaping the national security debate through think tank funding. Lockheed Martin in particular funds an array of other policy institutes and think tanks. The nexus of defense contracting money and think tanks is poorly understood, however, largely because detailed think tank financial disclosures are voluntary.

“Heritage and other think tanks that press for higher Pentagon budgets should come clean and give the full details of their contributions from weapons contractors,” said Hartung. “Otherwise their positions on what weapons to buy and what defense postures to adopt should be taken with a large grain of salt.”

Update: Eaglen responded in the comments on this article.

Caption: F-22 Raptor stealth fighter flies over Joint Base Elmendorf-Richardson in Anchorage, Alaska, September 21, 2011.