Michigan Governor Rick Snyder speaks at the funeral for Aretha Franklin. (Scott Olson/Getty Images)

Michigan’s governor has signed a directive to prevent LGBT discrimination.

A directive signed by Republican governor Rick Snyder will mean that companies seeking contracts, loans or grants from the state of Michigan must agree not to discriminate against LGBT employees.

With less than a week left in office, the executive directive was seen as a surprise by many. Snyder will be succeeded by Democrat Gretchen Whitmer, a long-time advocate of LGBT rights, on 1 January.

The directive, which is effective immediately, will require state departments and agencies to include language in contracts prohibiting anyone from hiring or firing on the basis of “religion, race, color, national origin, age, sex, sexual orientation, gender identity or expression, height, weight, familial status, marital status, or a disability or genetic information.”

“Michigan’s continued reinvention and economic growth depend on talented individuals choosing to live and work here,” Snyder wrote.

“It is essential for state government to be a leader in welcoming all people to our state and ensuring that everyone is treated fairly and with respect.” — Rick Snyder

Snyder added: “State government is one of the largest buyers of goods and services in Michigan, and therefore it is uniquely positioned to be a leader in ensuring fair treatment for people in employment.”

The directive includes an exception for nonprofit religious organisations, such as churches. Jay Kaplan, staff attorney for the LGBT Project at the ACLU of Michigan, told Crain’s Detroit Business that the exception could be a “back door to discrimination against LGBT people.”

“Whether the governor had good intent… this kind of language is definitely a step backward.”

Snyder’s eight-year tenure has not always been so welcoming of LGBT rights

In 2011, Snyder signed The Public Employee Domestic Partner Benefit Restriction Act into law, preventing same-sex domestic partners of public employees from receiving health benefits. That law was struck down in 2013. The governor signed a law in 2015 allowing faith-based adoption agencies to decline LGBT parents.

During a hearing In 2016, Snyder also faced criticism from Democrats for missing the warning signs of lead contamination in Flint’s water supply, leading to the city’s water crisis.

Snyder had also been encouraging an expansion of the Elliott-Larsen Civil Rights Act of 1976, suggesting the inclusion of new anti-discrimination protections for gay and transgender residents. While he has so far been unsuccessful, Gov.-elect Whitmer has said she will continue the fight for expansion when her tenure begins.