Federal buildings have served as the backdrop for scores of movie and television scenes over the years, and some of the cameo appearances have generated revenue for the government.

The General Services Administration, which manages federal properties, has raised more than $500,000 in the past three years through its “outleasing program,” which allows the agency to rent buildings, landmarks and ports of entry. All of the money goes toward maintenance and renovations of historic properties, the agency said.

The 1966 National Historic Preservation Act allows agencies to lease space in federal buildings to non-federal renters, with the proceeds going to preservation.

Last week the GSA highlighted some of the starring facilities on its blog. (It also encourages filmmakers to check out its leasing program.) Some examples:

●The Baltimore U.S. Custom House appears in the Netflix series “House of Cards.”

●Scenes from the 1980s classic “Ferris Bueller’s Day Off” took place at the Chicago Federal Building.

●The Alexander Hamilton U.S. Custom House in New York City showed up in two movies: “How To Lose A Guy In 10 Days” and “Black Swan.”

●The John Minor Wisdom U.S. Court of Appeals in New Orleans showed up in the Academy Award-nominated “JFK.”

●A courtyard in the David W. Dyer Federal Building and U.S. Courthouse in Miami appeared in “Absence of Malice,” a 1981 journalism film starring Paul Newman and Sally Field.

●Richmond’s Lewis F. Powell Courthouse was used in “The Contender,” a 2000 political thriller starring Jeff Bridges as a president whose nomination of a woman as his vice president blows up into a sex scandal.