A 64-year-old man who escaped from an Australian jail in the 1990s has surrendered after almost 30 years on the run, police said.

New South Wales police said the man allegedly used a hacksaw and bolt cutters to free himself from a prison north of Sydney in 1992.

"Between 7pm Friday 31 July and 7am Saturday 1 August 1992, a 35-year-old man escaped from a correctional centre on Hoof Street at Grafton," a statement said.

"At the time, efforts to locate the man were unsuccessful."

The Sydney Morning Herald, which said the man had been jailed on two counts of "cultivating a prohibited plant", reported he spent his time on the run living on Sydney's northern beaches.

On Sunday, the man walked into a Sydney police station to hand himself in.

The city's Daily Telegraph reported he had been homeless.

The man has been charged with escaping from lawful custody and is now back behind bars after being refused bail.