Texas lawmakers passed a bill Tuesday that will penalize professional sports teams if they do not play the national anthem before games.

The Republican-backed bill would require government entities to enter a written agreement with professional sports teams affirming that they will play the national anthem. Teams that do not comply with the agreement could lose their state and local subsidies or be barred from entering into future contracts with the state.

Texas Lt. Gov. Dan Patrick was a staunch advocate for the bill, dubbed the "Star Spangled Banner Protection Act." The measure was first introduced in February after the Dallas Mavericks briefly stopped playing the national anthem before their home games.

"Texans are tired of sports teams that pander, insulting our national anthem and the men and women who died fighting for our flag," Patrick said in a statement in April. "The passage of SB 4 will ensure Texans can count on hearing the Star Spangled Banner at major sports events throughout the state that are played in venues that taxpayers support. We must always remember that America is the land of the free and the home of the brave."

The Texas House of Representatives passed the bill in a 110-34 vote. The measure previously passed the Texas Senate with bipartisan support in April. Texas Gov. Greg Abbott is expected to sign the bill into law.

The bill drew criticism from some state Democrats who argued it constituted governmental overreach and violated First Amendment protections.

"Once again, we’re carrying legislation that is openly and aggressively unconstitutional," Democratic State Rep. Gene Wu said, according to the Houston Chronicle.

CLICK HERE TO GET THE FOX NEWS APP

The Mavericks drew criticism from local lawmakers last February after the team stopped playing the national anthem at the direction of owner Mark Cuban. The NBA later affirmed a league rule requiring teams to play the anthem before home games.

Cuban told ESPN the decision to stop playing the anthem came after consultations with both NBA Commissioner Adam Silver and the local community.

"In listening to the community, there were quite a few people who voiced their concerns, really their fears that the national anthem did not fully represent them, that their voices were not being heard," Cuban said at the time.