Washington — Consumers wanting to know if their foods contain genetically modified ingredients will be able to find out for the first time.

Congress sent legislation to President Obama on Thursday that would require most food packages to carry a text label, a symbol or an electronic code readable by smartphone that indicates whether the food contains genetically modified ingredients, or GMOs. The Agriculture Department would have two years to write the rules.

The White House said Obama will sign the bill, which would pre-empt a Vermont law that kicked in earlier this month. The House passed the legislation 306-117 on Thursday.

Senate approval came last week over the strong objections of Vermont’s congressional delegation. Sens. Bernie Sanders and Patrick Leahy and Rep. Peter Welch argued that the measure falls short, especially compared with the tougher labeling requirements in their state.

Rep. Annie Kuster, D-N.H., also voted against the measure.

While the bill gives companies the three options for labeling, the Vermont law would require items be labeled “produced with genetic engineering.”

“If there is an acknowledgement about the right of a consumer to have access to information, why not give them the information in plain and simple English?” asked Welch on the House floor.

Advocates for labeling and the food industry, which has fought mandatory labeling, have wanted to find a national solution to avoid a state-by-state patchwork of laws. The food industry supports the legislation, which was the result of bipartisan Senate negotiations. But many advocates do not, arguing that many consumers won’t be able to read electronic labels and that there aren’t enough penalties for companies that don’t comply.

While there is little scientific concern about the safety of those GMOs on the market, advocates for labeling argue that not enough is known about their risks and people want to know what’s in their food. Among supporters of labeling are many organic companies that are barred by law from using modified ingredients in their foods.

The food industry says GMOs are safe and the labels could mislead people into thinking they aren’t. But several companies started to label their foods anyway as Vermont’s law went into effect.

Vermont’s Democratic Gov. Peter Shumlin bemoaned the congressional action.

“It’s a shame that Congress chose to replace our standard with a weaker one that provides multiple ways for the food industry to avoid transparent labeling,” he said in a statement.

Republicans and lawmakers from rural states overwhelmingly supported the legislation. Agriculture groups have backed it, hoping it will bring more certainty to farmers who grow genetically modified corn and soybeans.

“The clock has run out, my producers need certainty and an interstate commerce nightmare will shortly ensure if we don’t pass this bill,” said Rep. Rodney Davis, R-Ill.

Genetically modified foods are plants or animals that have had genes copied from other plants or animals inserted into their DNA.