Victoria will become the first state to erase the criminal records of men who were previously convicted for having gay sex, in a long-awaited shift by the state government.

With 10 months before the election, Denis Napthine will announce the policy on Sunday, when he becomes the first premier to launch Midsumma, Melbourne's annual gay and lesbian festival.

The move will end decades of anxiety for countless men who were prosecuted before homosexuality was decriminalised in Victoria in 1981. Before decriminalisation, men who had consensual sex with other men were convicted of crimes such as ''buggery'' and ''gross indecency with a male person'', restricting them from travelling, volunteering or applying for jobs such as teaching.

With at least 100,000 people expected to attend Sunday's event, Dr Napthine will tell the crowd that ''these convictions have been allowed to stand for far too long'' and had stigmatised many people who had been forced to live with the burden of a criminal record.