WASHINGTON — Within hours of the assassination of President John F. Kennedy, the CIA started to distance itself from any connection to suspected assassin Lee Harvey Oswald, recently released secret records from the National Archives show.

While CIA agents had picked up on Oswald while he was in Mexico City in September 1963 trying to return to the Soviet Union, where he had defected in 1959, they did not pay much attention to him, according to a Sept. 18, 1975, CIA report that attempted to explain what the agency knew about him.

That file, released Friday, shows the agency knew about the travels of Oswald, a former Marine sharpshooter, as he moved to the Soviet Union, returned to the United States with a Russian wife, demonstrated in support of Cuba's communist government and traveled to Mexico City before the Nov. 22, 1963 assassination.

The files were released under the requirements of the President John F. Kennedy Assassination Records Collection Act of 1992, which required all documents compiled as part of investigation into Kennedy's murder to be released by Oct. 26, 2017. On that day, 2,891 files were released in full. Others, including the 676 released Friday were censored, in some parts to maintain the secrecy of sources who are still alive.

The Sept. 18, 1975, CIA memo on Oswald was released as a Senate committee led by Sen. Frank Church, D-Idaho, investigated abuses by the CIA, FBI and other intelligence agencies. Details about the Kennedy administration's attempts to overthrow the government of Cuban dictator Fidel Castro or assassinate him had emerged from the committee investigation, as well as theories that Castro may have been involved in trying to kill Kennedy.

Much of the memo from CIA official Paul Hartman was meant to explain why the agency, although it had picked up traces of Oswald during his travels, did not consider him a threat.

"I recall very clearly we were extremely concerned at the time that OSWALD, as an American returning from the USSR, might have been routinely debriefed by [the Domestic Collection Division], thus having established contact with the Agency," Hartman wrote. "The same point has now, quite understandably, been made by the two CBS newsmen. Having some knowledge of this subject I have personally concluded that there is valid reason for DCD's lack of interest in OSWALD at that time."

"It should be noted that no particularly great urgency was attached to the records regarding Oswald before the assassination because Oswald's name had no particular meaning before that fateful event," Hartman wrote.

More:CIA director misled FBI about how agency spied on Pentagon Papers leaker

More:Russian-born oilman, a real international man of mystery, a vivid presence in JFK files

Other documents released Friday showed that the CIA had monitored the Soviet Union and Cuba's embassies in Mexico City and spotted Oswald there in September 1963. Oswald was trying to get visas to travel to Cuba and the Soviet Union.

The CIA was eavesdropping on telephone calls at both embassies and had picked up Oswald on a wiretap to the Soviets as he tried to get a visa to go to Odessa.

The lack of agency cooperation with the Warren Commission, the special group appointed by President Lyndon Johnson to investigate the assassination, was a topic of multiple documents in the recent release.

A March 9, 1964, memo to J. Lee Rankin, the chief counsel to the commission, noted problems with information the CIA gave the commission the previous month.

"If the file supplied by the CIA is the official dossier on Oswald, then it contains no reports received by headquarters from the Mexican station or any other foreign office and it supplies no information regarding the dissemination of material by CIA to other federal agencies," the memo said.

Commission investigator Edward Williams wrote that Richard Helms, then the CIA's deputy director of plans, said "they would prefer not to comply with" another request for information.

Also released Friday were other CIA files about the Cuba connection, including records on operatives who had been involved in the unsuccessful April 1961 invasion at Cuba's Bay of Pigs by an agency-backed band of exiles. They included agent E. Howard Hunt, Bernard Barker and Frank Sturgis, who would later be arrested and imprisoned for breaking into the Democratic National Committee headquarters in Washington's Watergate office complex on June 17, 1972.

That failed break-in set off the two-year political scandal that led to the resignation of President Richard Nixon, whom Kennedy defeated in 1960.

The CIA, then led by Helms, declined to help Nixon block the FBI investigation of the Watergate break-in and also declined to provide information about the agency's ties to Nixon's attempts to smear the reputation of Daniel Ellsberg, an anti-Vietnam War activist who leaked the so-called Pentagon Papers to newspapers in 1971.

More:JFK files: FBI warns Robert Kennedy about book alleging affair with Marilyn Monroe

More:JFK files: Highlights from 2,800 previously classified records

Contributing: Jessica Estepa and Julia Fair.