Half of Americans support passing a law banning discrimination by employers against gays and lesbians, a new HuffPost/YouGov poll shows -- and even more Americans agree that it should be illegal to fire someone for being gay.

The poll comes after President Barack Obama announced that his staff was drafting an executive order prohibiting job discrimination against LGBT employees of federal contractors. The Employment Non-Discrimination Act, a broader bill that would apply to most U.S. employers, has passed the Senate but not the House.

In the new survey, 50 percent of Americans favored and 38 percent opposed legislation banning job discrimination against gays and lesbians. The poll found political division on the issue: 63 percent of Democrats and 52 percent of independents favored that kind of legislation, but only 34 percent of Republicans did.

But on at least one major protection the legislation would provide, all three groups were united. Seventy-six percent of Americans, including 88 percent of Democrats, 74 percent of independents and 68 percent of Republicans, said that it should be illegal to fire someone for being gay or lesbian. Only 12 percent of Americans said it should be legal.

The fact that far more Americans agree with the principle than with the legislation may be attributable to a common misconception: Sixty-two percent of Americans think it's already illegal to fire someone for being gay, while only 14 percent of poll respondents said that it's legal. In fact, it is still legal in 29 states to fire someone for being gay.

Majorities of Democrats, Republicans and independents all think it's already illegal to fire someone for their sexual orientation.

The HuffPost/YouGov poll was conducted June 16-18 among 1,000 U.S. adults using a sample selected from YouGov's opt-in online panel to match the demographics and other characteristics of the adult U.S. population. Factors considered included age, race, gender, education, employment, income, marital status, number of children, voter registration, time and location of Internet access, interest in politics, religion and church attendance.