Omar Mateen told his bosses at G4S he responded by making up stories that he had connections to terror suspects.
The FBI investigated his remarks but determined he did not pose a threat, the documents show.
Mateen killed 49 people and wounded 53 more before being shot dead by police.
He pledged allegiance to the so-called Islamic State group during a call to police shortly before the attack on 12 June and the group later described him as one of its fighters.
FBI agents questioned Mateen twice in 2013 following comments he made to colleagues that he had links to the suspects in the Boston Marathon bombing and also to Nidal Hasan, a former US Army major sentenced to death for the murders of 13 people at Fort Hood in Texas in 2009.
The records released by the St Lucie County Sheriff's Office in Florida show that Mateen complained of being repeatedly taunted for being a Muslim while working as a security guard at the local courthouse.
He said a fellow guard had teased him, saying: "We have to be careful - Omar may send us a bomb and he will get his 72 virgins."
Mateen said that on another occasion a deputy told him he had pork oil on his fingers and he was going to rub them on Mateen's shirt. Muslims consider pork unclean.
According to the documents, Mateen told his employers he had responded to the taunting by making up the stories about ties to people in terror cases.
In a letter to his bosses at private contractor G4S he wrote: "I love the United States. The boasting, I did it just to satisfy the gang of co-workers who ganged up against me. I'm 1,000% pure American. I'm against these terrorists, any one of them."
Mateen was questioned by the FBI again in 2014 about a potential connection to Moner Mohammad Abu-Salha, the American known to have carried out a suicide bombing in the Syria conflict.
The investigation found no "substantial relationship" between Mateen and Abu-Salha and the case was closed, the FBI said.
Mateen, 29, was born in New York to Afghan parents.
The attack on the Pulse nightclub  was the worst mass shooting in modern US history.
A gunman who killed dozens of people in an Orlando gay club had complained of being taunted for being Muslim while working as a security guard at a court, newly released documents show.