US oil giant Exxon Mobil has updated its employment policies to officially prohibit discrimination against LGBT workers in order to comply with a new federal law.

The modification came as President Barack Obama signed an executive order that bans federal contractors from discriminating against LGBT workers.

Exxon Mobil has secured oil supply contracts worth millions of dollars from the government, and entered into lease agreements to work on federal lands.

"It is the policy of Exxon Mobil Corporation to provide equal employment opportunity in conformance with all applicable laws and regulations to individuals who are qualified to perform job requirements regardless of their race, colour, sex, religion, national origin, citizenship status, age, genetic information, physical or mental disability, veteran, sexual orientation, gender identity or other legally protected status," the company's updated equal employment opportunity policy reads.

In addition, its new "harassment in the workplace policy" now prohibits harassment based on sexual orientation and gender identity.

The company's spokesman, Alan Jeffers, confirmed the Irving, Texas-based oil major added these protections to comply with federal law.

The company previously resisted investors' calls for such an official change, saying it already prohibited all forms of discrimination at its offices across the globe.

It was the lowest ranked among big US companies for LGBT inclusion in an assessment by Human Rights Campaign. The LGBT advocacy organisation said the recent change was just a response to Obama's order rather than a shift in Exxon's corporate values.

"This wasn't prompted by a change of principles or corporate values, it represents Exxon's response to President Obama's July 2014 executive order that prohibits federal contractors from discriminating against LGBT people," said Deena Fidas, director of Human Rights Campaign's Workplace Equality Program.

Exxon's peers such as BP, Shell and Chevron reportedly maintain more liberal policies for LGBT workers.