Ex-Mexican President Luis Echeverria has been cleared of genocide charges after a judge ruled the alleged events took place too long ago.
Echeverria was interior minister at the time of the killings
Mr Echeverria, 84, has been released from the house arrest that was ordered on 30 June, his lawyer said.
The former president was accused of involvement in the deaths of up to 300 students when troops opened fire on protesters in 1968.
The judge ruled the matter was beyond the nation's statute of limitations.
Mr Echeverria was interior minister in 1968 at the time of the killings in Tlatelolco Square in Mexico City.
He denied allegations that he posted snipers on scores of buildings and gave orders to shoot anti-government protesters.
"Nothing proves that I was the author of or participated in any crime," Mr Echeverria said recently in a written statement.
"To say that genocide was committed against students on 2 October 1968 is an absurd distortion of the clash that happened that day," his statement said.
An appeals court recently delivered a surprise ruling that there was enough evidence to support genocide charges.
Mr Echeverria was president from 1970 to 1976 during which hundreds of people died or disappeared during the "Dirty War" on leftists.