ABILL SIGNED into law last month by Maryland Gov. Martin O’Malley (D) regarding a commuter train contract and the Holocaust — yes, you read that correctly — must qualify as among the strangest and most self-defeating to emerge from Annapolis.

The law gives the state archivist — not transportation officials — what may well be the critical role in determining who can bid on a $250 million contract to run two MARC commuter lines, including the one between Washington and Baltimore. It became law despite warnings it would endanger Maryland’s federal transportation funding. State officials are considering accounting gimmicks — which may not work — to safeguard the critical flow of federal dollars.

That would be a steep price to pay for a showy bit of legislative posturing intended to make the point that Maryland lawmakers stand unalterably opposed to the Holocaust.

The bill’s target is SNCF, the French national railroad company that has repeatedly acknowledged, and apologized for, its role during World War II in transporting more than 75,000 Jews from France to Germany, where most perished in Nazi death camps. Like some other companies under the boot of Nazi occupation, there’s no question about SNCF’s complicity. The French government, as the railway’s owner, has paid out about $1 billion in reparations to Holocaust survivors and relatives of victims, including those transported by SNCF.

Today, SNCF owns a majority stake in Keolis, an American company that operates commuter rail in Virginia; it wants to bid on the MARC lines. As one of the handful of multinational firms up to the job, SNCF, through Keolis, was the only contender for the MARC contract last year when the state halted bidding for lack of competition.

Maryland is preparing to open bidding again, but this time with its thumb on the scale. The new law, borne through the legislature on a tsunami of emotion and pandering, requires SNCF to satisfy tortuous demands to assure lawmakers that the firm has made full disclosure about its wartime role, and has scoured and digitized its archives to Maryland’s satisfaction. If SNCF fails to comply, Keolis can forget the MARC contract. And who will be the ultimate arbiter of compliance? Edward C. Papenfuse, Maryland’s state archivist.

We mean no disrespect to Mr. Papenfuse, a distinguished historian. But SNCF’s main archives have been open to the public for 15 years, and it was already at work digitizing its millions of documents without Maryland’s prompting. Now it has been hit with pages of exquisitely detailed statutory demands, including some that may fly in the face of French law or archival standards. The company says it is unsure it can comply in time to bid on the MARC contract.

Federal and state officials, as well as Maryland’s Attorney General’s Office, raised red flags about the bill, the first of its kind to become law in the country. Some warned it was legally dubious; others that it imperiled federal funding by imposing arbitrary procurement demands on a single company; others that it put Maryland firms at risk of retaliation. The warnings were ignored by lawmakers intent on bullying a foreign firm to prove their anti-Nazi bona fides.

The only sensible thing now is to modify or repeal the bill when the legislature meets in a special session this fall. It’s one thing to enact a reckless law; it’s another to allow legislative showboating to jeopardize critical state functions.