It started with the n-word. White people had used the racial epithet to demean Teshawn Solomon in the past, he said, but until that point none of them had been a supervisor at his job.

It was 2017 and Mr Solomon was working as a warehouse specialist in Sacramento for Vivint Solar, an energy company that specialises in home automation, security and residential solar energy systems. Without warning, the supervisor referred to him using the racist language, he recalled.

On another occasion, another supervisor told him to "reach his black hands out" when he was being handed a box, Mr Solomon alleged. The same supervisor used a banana to humiliate Mr Solomon at one point, according to the African-American father of four.

"Monkeys like bananas," he said, offering Mr Solomon the piece of fruit.

Eventually, Mr Solomon alleged, his white co-workers used cardboard boxes to build a protective fort around their desks. He said the structure was spray-painted with the words "white only" and remained intact for two weeks.

With the racist incidents piling up, Mr Solomon said he felt increasingly isolated and began to fear for his safety when he was at work.

"I was terrified," the 36-year-old said. "The only other African-American employee was usually at other warehouses, so I was alone, at night, looking over my shoulder, wondering what else could happen to me."

"All I wanted was respect and the dignity of providing for my family," he added.

The alleged incidents of racial harassment are detailed in a lawsuit filed late on Monday in California Superior Court in Sacramento County.

In the suit, Mr Solomon accuses his former employer of racial harassment and discrimination, both of which are violations of California's Fair Employment and Housing Act.

He also accuses Vivint Solar's managers of failing to prevent racial discrimination and actively encouraging him not to take his complaints to the company's human resources department.

Mr Solomon said he knew he would have no opportunity to advance and make a better life for his family if he remained with Vivint Solar. After more than a year with the company, he resigned in March, deciding that he "could no longer tolerate the hostile work environment, brazenly racist conduct, and management's indifference to it," the suit states.

"Management did nothing after I complained," Mr Solomon said. "They didn't hold anyone accountable. People continued joking about the fort for weeks because they knew management didn't care about racism."

Vivint Solar has its headquarters in Lehi, Utah, and employs more than 4,000 people in 21 states.

"We typically have a policy of not commenting on specific personnel matters or pending litigation," Vivint said in a statement released to The Washington Post. "However, in this case, we wish to extend a sincere apology to Mr Solomon for the deeply concerning and understandably upsetting situation he endured."

Five ways to disrupt racism

"Mr Solomon's experience was an isolated one and it has been addressed by our HR team to ensure something like this never happens again," the statement added.

"Mr Solomon's experience simply does not reflect the values or culture of Vivint Solar and stands in direct contradiction to our core values as a company."

Responding to Vivint Solar's statement, Mr Solomon's attorney, Corey Bennett, said his client was forced to choose between a "dehumanizing work environment" and unemployment.

"When employees freely use racial slurs on a daily basis, brazenly construct a racist monument in plain sight and are then shielded by management, it is only because the culture allowed it," he said.

Photos taken inside the warehouse and provided to The Washington Post by Mr Bennett appear to show several desks surrounded by cardboard boxes, filing cabinets and stacks of water bottles. Scrawled above the "white only" sign are the words "Inspections Department."

Mr Bennett said the photos were taken by another employee who left the company after complaining about racial harassment and then passed the images to his client, who also took photos of the structure before it was taken down.

Mr Bennett, a San Francisco-based lawyer specialising in employment law, said he is familiar with cases in which minority workers are harassed using nooses or swastikas. But he's never encountered a racist play fort inside a workplace. He called the structure "bizarre."

"If you look at that photo you can get a sense they wanted to make their own little hideout," Mr Bennett said. "I think these people thought they could do whatever they wanted to without any oversight or accountability."

Mr Bennett said his client grew up in Long Beach, California, and spent 12 years in prison before getting out in 2012. Ever since, he said, Mr Solomon has been trying to work hard and "do right by himself and his family." At Vivint, he was responsible for maintaining equipment and assisting with various tasks around the warehouse.

Despite being subjected to racial discrimination, the attorney said, Mr Solomon excelled at his job and was promoted from a part-time to full-time role after six months.

"He thought this company was actually going to be a place he could stay for a while," Mr Bennett added. "As an African-American, he's got to work harder as it is, and as an ex-convict he's got to work that much harder. Then he found himself at a workplace that made his daily life miserable."