Senators from Australia’s ruling Liberal-National coalition have backed a motion brought by the anti-immigration One Nation party saying “it is okay to be white”.

The motion, described as “straight out of the alt-right playbook” by Labor senator Kristina Keneally, was defeated by 31 votes to 28. The Labor Party, the Greens and crossbenchers combined to vote down the statement, which sought to have the Senate acknowledge the “deplorable rise of anti-white racism and attacks on western civilisation”.

Among those voting in support of the motion was Liberal senator Lucy Gichuhi, who emigrated from Kenya and is the first person of black African descent elected to the Australian parliament.

Other government members who backed the motion included the ministers for trade, small business, resources, communications and indigenous affairs. The ministers for finance and foreign affairs and five other coalition senators were absent for the vote, but were paired with Labor senators intending to vote against the motion. This means the seven Liberal and National members would have voted for it if they had been in the chamber.

Burka

One Nation leader Pauline Hanson, who moved the “okay to be white” motion, previously wore a burka in the Senate in a stunt to promote her call for the Islamic dress to be banned in Australia.

Independent Derryn Hinch accused Ms Hanson and her former colleague, Fraser Anning, of engaging in “a race to see who can be the biggest, the loudest, racist bigot, in their contest to see who can get to the bottom of the sewer first”.

In August, Mr Anning (who left One Nation to join Katter’s Australian Party) called for a “final solution” to immigration. He later claimed to not have known the connotation of the phrase.

In the debate around the motion, Greens leader Richard Di Natale said the phrase “‘it’s okay to be white” has got a long history in the white supremacist movement”.

Mr Di Natale said the “privileged white Anglo community” holds positions of power, including in the Senate, while Aboriginal Australians were “more likely to die younger, to be locked up” and African people were “more likely to experience racism”.

In January, home affairs minister Peter Dutton said people in Melbourne were “scared to go out to restaurants” because of “African gang violence”.

The government will lose its majority in the lower house of parliament on Saturday if it fails to win a byelection to replace former prime minister Malcolm Turnbull, who was ousted in an internal Liberal Party coup in August.

Ms Keneally sent a tweet from parliament addressing those voting this weekend. “Right now in the Senate – the Liberals & Nationals are voting to support Pauline Hanson’s motion about ‘anti-white’ racism,” she said.