The FBI and US state department closely monitored the Mexican author Carlos Fuentes for more than two decades because he was considered a communist and a sympathiser of Cuba's Fidel Castro, recently released documents show.

The documents posted on the FBI's website show the US denied Fuentes an entry visa at least twice in the 1960s. In one of the memoranda Fuentes is described as "a leading Mexican communist writer" and a "well-known Mexican novelist with long history of subversive connections".

Fuentes died in 2012 at age 83 after suffering an internal haemorrhage.

In the 170-page dossier of internal official documents and some newspaper articles, the FBI describes how it monitored Fuentes and denied him permission to enter the US for having been a member of the Mexican Communist party.

One of the 20th century's most influential Latin American authors and intellectuals, Fuentes backed Castro after he took over Cuba and supported the Sandinista revolution in Nicaragua. But Fuentes' good relations with the Cuban government ended in 1971 when he joined protests over its treatment of poet the Heberto Padilla, something Cuban officials never forgave him for.

The first documents date from 1962 when Fuentes received an invitation to go to the US for a televised debate with the then secretary of state, Richard Goodwin. A note dated 3 April 1962 states that until that day Fuentes had not requested a visa at the US embassy in Mexico and adds that there were instructions from Washington to delay his application and await further instructions.

The FBI's file for Fuentes includes newspaper articles about how his visa application was later denied.

Although Fuentes was denied an entry visa more than once, the Mexican writer did make several visits to the US and was granted permission to teach at American universities. But authorities continued to track him in US territory.

In a memorandum from October 1970 addressed to the FBI's director, the bureau suggests finding sources and informants at Columbia and New York University who could monitor Fuentes. The memo warns against an active investigation because of media attention.

"Because of Fuentes' prominence as an author, the publicity which has attended his prior visa refusals and his indicated connection with two New York City universities, no active investigation regarding him is desired at this time," the document reads.

It ends with a note stating that Fuentes has a "long history of subversive connections and has traveled to the Iron Curtain and Cuba".

Once considered a communist, Fuentes spent some of his childhood in the US as the son of a Mexican diplomat. He said it grated on him that his left-of-centre politics meant he often was portrayed as anti-American. "To call me anti-American is a stupendous lie, a calumny. I grew up in this country. When I was a little boy I shook the hand of Franklin Roosevelt and I haven't washed it since," he said with characteristic good humor in a 2006 interview in Los Angeles.

More recently, as a moderate leftist, Fuentes strongly opposed US tactics in the crackdown on immigration as part of the war on terrorism. But he also blasted Venezuela's Hugo Chávez as a "Tropical Mussolini".

The FBI files show how over time the bureau changed its views about Fuentes. Early on the FBI highlighted his leftist tendencies but in 1985 he is described as a prominent author and is given a visa to teach at Harvard.

In Fuentes' application US authorities say that even though he had been deemed ineligible for an entry permit for being a member of a banned organisation in the early 1960s, an apparent reference to the Mexican Communist party, he should be given a visa to go to Harvard because he is an "outstanding 20th century Mexican author".

The FBI released the documents after NYCity News Service filed a request in September 2012 for Fuentes' FBI file under freedom of information, which requires the agency to release certain documents to the public once a person has died.