Congress hasn't been allowed to wear hats on the House floor since 1837, but the newly Democratic-controlled House voted to change that to accommodate lawmakers who wear religious headwear.

House Speaker Nancy Pelosi, D-Calif., and Rules Committee Chairman Jim McGovern, D-Mass., proposed the changes last month and it passed Thursday 234-197. The changes allow one of the first female Muslim members of Congress, Rep. Ilhan Omar, D-Minn., who also co-authored the proposal, to wear her headscarf.

NEW CONGRESS HAS FEW CHRISTIANS, MORE RELIGIOUS DIVERSITY

The new rule reads: “During the session of the House, a Member, Delegate, or Resident Commissioner may not wear nonreligious headdress or a hat or remain by the Clerk’s desk during the call of the roll or the counting of ballots," the rule change reads.

Omar celebrated the change Friday on Twitter, calling it a move to make Congress "more inclusive for all" with an apparent swipe at the Trump administration.

"I thank my colleagues for welcoming me, and I look forward to the day we lift the Muslim ban separating families all over the U.S. from their loved ones," she wrote.

Florida Rep. Frederica Wilson, known for her wide collection of hats, tried to get the rule evoked in 2010, calling it “sexist,” according to the Miami Herald.

“It dates back to when men wore hats and we know that men don't wear hats indoors, but women wear hats indoors,” Wilson said. “Hats are what I wear. People get excited when they see the hats. Once you get accustomed to it, it's just me. Some people wear wigs, or high heel shoes or big earrings or pins. This is just me.”

While her efforts were unsuccessful, a spokesman for then-House Speaker John Boehner told PolitiFact: “The rule regarding hats has never been interpreted to apply to religious headcoverings.”

FIRST DAY OF 116TH CONGRESS BEGINS WITH PRAYER, ENDS WITH A PROFANITY

Nathan Diament, executive director of the Orthodox Union Advocacy Center, which represents the interests of Orthodox Jews, said no Jewish House member had made the ban an issue in the past.

But there have been special House sessions when Jewish men wore head coverings — including when Israeli Prime Minister Benjamin Netanyahu addressed Congress, and Israeli officials wore kippahs or "kippot" in Hebrew.

“The Orthodox Union has long supported laws and policies that foster the accommodation of religious practices in the workplace," Diament told the Washington Post. "Religious practices — such as wearing religious garb, whether a kippot or a hijab, should be accommodated in all workplaces — including in the halls of Congress,”