The deal is part of a framework agreement with the prison service.
Work is expected to start next month, with the blocks due for completion in 2005. The buildings will include healthcare, educational and recreational facilities.
Skanska director Willie Smith said the firm’s “previous” in prisons had stood it in good stead for the Scottish work.
He said: “We are turning our growing knowledge of the client’s business into tangible benefits.”
The schemes are part of a £3bn, 10-year plan to refurbish and extend Britain’s prison stock, as revealed in Building last week.
St David’s Barracks, Bicester, for Defence Estates.