Sgt. 1st Class James Gordon III of the 3rd U.S. Infantry Regiment prepares to place a flag at Arlington National Cemetery before Memorial Day in 2014. (Matt McClain/The Washington Post)

Many Americans gathering to celebrate Independence Day will mark the holiday at Arlington National Cemetery. But for visitors feeling patriotic, there is one item that is banned on the hallowed grounds: a waving American flag.

Earl Granville, a retired Army staff sergeant and veterans advocate who lost his leg in a bombing in Afghanistan, said that he was surprised to learn about the obscure federal law that prohibits visitors from carrying an unfurled U.S. flag at the cemetery.

“There’s absolutely, positively nothing disrespectful whatsoever about carrying the colors to the cemetery where our fallen armed forces are buried,” Granville said.

The law — 38 U.S. Code § 2413 — emerged in 2006 when former U.S. Rep. Mike D. Rogers (R-Mich.) grew angry after watching mourners at a military burial face “chants and taunting and some of the most vile things I have ever heard,” Rogers told the Associated Press at the time.

Rogers was referring to protests by members of the Topeka-based Westboro Baptist Church, who showed up at Arlington burials with posters chiding mourners with messages such as “Thank God for dead soldiers.” They picketed military funerals, claiming that combat deaths represented God’s anger for the country’s tolerance of homosexuality.

(Julie Percha/The Washington Post)

In response, Rogers helped write the “Respect for America’s Fallen Heroes Act,” a bill that made it illegal to protest funerals held at Arlington Cemetery and the 135 burial grounds run by the National Cemetery Administration. In its broad definition of “demonstration,” the legislation specifically made it unlawful to display “any placard, banner, flag or similar device.”

A violation carries a penalty of up to a year in prison.

“Families deserve the time to bury their American heroes with dignity and in peace,” Rogers told the Associated Press in 2006. Rogers did not respond to repeated requests for comment from The Washington Post.

The bill received widespread bipartisan support and passed easily.

The American Civil Liberties Union opposed the law, saying it raised the possibility of government censorship.

But Lee Rowland, an ACLU lawyer, said that when it comes to flags, the law is written carefully. By banning all flags, the law purposely avoids violating a visitor’s First Amendment right to free speech.

“In the eyes of the law both an American flag and a Nazi flag express a clear message and thus are both worthy of First Amendment protections no matter how much we may disagree with one of them,” Rowland said. “It’s an all-or-nothing proposition . . . Even if the results in practice may feel unjust.”

Tim Marshall, the author of the 2017 book, “A Flag Worth Dying For: The Power and Politics of National Symbols,” said that the American flag has represented, liberty, loyalty and rebellion. Although hoisting the flag can be a form of patriotism, Marshall said, burning it can also be an expression of freedom.

The law that prevents Arlington visitors from carrying the flag, Marshall said, has a “paradoxical logic in it. That to uphold one freedom, you curtail another.”

Arlington spokeswoman Barbara Lewandrowski said that before Memorial Day, members of the Army’s 3rd U.S. Infantry Regiment place small flags in front of each of the cemetery’s 280,000-plus headstones and burial markers. These small flags are exempt from the law, which allows for displays as “part of a funeral, memorial service, or ceremony.”

“Arlington National Cemetery staff works diligently to honor and respect all families who come to pay their respects to loved ones and we tirelessly ensure a safe and peaceful environment for our visitors,” Lewandrowski wrote in a statement to The Post.

Several regulations tightly govern decorum at the cemetery to preserve the sanctity of the burial ground. Flowers left at graves are removed as soon as they become wilted and visitors are not allowed to affix anything to the headstones, including photographs of the deceased. It’s all part of the tradition of Arlington, said Joe Davis, a spokesman for the Veterans of Foreign Wars.

“There is no more patriotic and revered place in America than Arlington National Cemetery,” Davis said. “But being a military installation, rules must still be abided by.”

Six years ago, Keith Jolly, a former Marine, founded the Ruck to Remember, a commemorative 60-mile march to the cemetery’s Section 60, where a majority of the casualties of Iraq and Afghanistan are buried.

In May, more than 150 people participated in the charity event, Jolly said. But before entering the cemetery, he said, participants were told to roll up their flags or fold them and place them inside their rucksacks. Jolly said that he does not agree with the law, but he won’t let it interfere with the spirit of the Memorial Day weekend march, which is “about those laid in there in the cemetery.”

“I wish there was a way,” to carry flags on the grounds, Jolly said. “It’s not ideal . . . It’d be perfect if we could.”

Paul Rieckhoff, founder and president of the Iraq and Afghanistan Veterans of America, said that the law banning flags at Arlington Cemetery is “ripe for adjustment or amendment to provide flexibility for respectfully presenting the colors.”

Rieckhoff said that the law remains largely unknown, noting that if members of the IAVA network were aware of it “they’d be outraged.”

“If someone is in there with the colors in a respectful way, or paying homage in a respectful way, then they should allow it,” Rieckhoff said.