WASHINGTON — Kevin Spacey and the producers of “House of Cards” are getting a lesson in bare-knuckle politics from the Maryland legislature.

Media Rights Capital Studios collects millions in tax breaks to film the popular Netflix series about the dark side of US politics. But the company overreached when it threatened to “set up in another state” if Maryland didn’t increase the benefits.

The backlash culminated in the state House of Delegates passing an amendment to seize the company’s equipment through eminent domain if it abandons the state.

The state Senate passed legislation to more than double the tax credits.