A new jail is to be built at Peterhead to house sex offenders, replacing the Victorian building there and retaining prison officer jobs in the north-east.

The announcement is expected today when Justice Secretary Kenny MacAskill visits the town with the director of the Scottish Prison Service (SPS).

He is also expected to set out plans to reduce prisoner numbers in Scotland by more extensive use of non-custodial sentences.

The SNP administration wants to limit its prison building programme to replacement of current capacity, rather than adding to it. This is in the hope that prisoner numbers can be cut back by tackling offending behaviour early and then pushing harder for more use of alternatives to jail.

But the drive to encourage sentencers to use various forms of community sentence has run into trouble, according to the executive's own research. It found such reluctance from sheriffs and justices of the peace to use the new range of sentencing options that it is hard to evaluate whether they work.

The current Peterhead prison is to be shut down because it is too difficult to renovate, even to pipe water to cells. There has been SPS resistance to building a replacement on neighbouring land. But First Minister Alex Salmond, a north-east MSP and MP, has been prominent in the campaign to secure the prison's future there. Along with protecting local jobs, he has argued Peterhead staff should continue their respected rehabilitation programme for sex offenders.

The new building is not to be run by the private sector, after Mr MacAskill ruled new prisons will not be operated for profit. As The Herald reported yesterday, that includes the planned new prison at Low Moss near Kirkintilloch in East Dunbartonshire, which had been earmarked for a private contract but will now be brought in-house by the SPS.

Labour responded to his announcement with mixed messages. The new Scottish leader, Wendy Alexander, said the SNP minister had reached "the right solution" by having it publicly run.

Later, justice spokesman Paul Martin said the question was not whether a new prison should be public or private, but whether it rehabilitates effectively and offers the best value for money.

According to Edinburgh University research, few of those receiving community orders saw a link between the work they were required to carry out and the communities affected by their crimes.