Smoking will be banned in Scotland's prisons by the end of 2018, following a major review.
The Scottish Prison Service (SPS) has set the target date for its estates to become smoke-free in response to concerns about second-hand smoke.
On Monday, the SPS revealed a report into the effects of second-hand smoke on prisoners and staff.
The Tobacco in Prison Study (TIPS), led by experts at Glasgow University, found typical non-smoking prison workers were exposed to as much second-hand smoke as someone living with a smoker.
TIPS was described as the world's most comprehensive study into the effects of smoking in prison.
Around 70% of people in prisons smoke, compared to around 20% of the Scottish public in general.
Prisons were exempted from the ban on smoking in public places which was introduced in Scotland in 2006, but regulations mean smoking has been restricted to cells and outdoor yards.
Colin McConnell, chief executive of the SPS, said: "This report is a call to action. It is not acceptable that those in our care and those who work in our prisons should be exposed to second hand smoke.
"We have already put measures in place to reduce this risk by insisting that prisoners close their cell doors when they are smoking, thereby reducing the exposure of that smoke to others.
"We have also modified our daily working practices to reduce this secondary exposure.
"However, the fact remains that the only way to remove this risk is to remove smoking from our prisons so I am today committing the SPS to achieving a smoke free prison estate by the end of 2018."
He continued: "This will be a significant challenge. The percentage of people who smoke in prisons is much higher than the community at large.
"I fully understand how difficult it will be for many in our care to give up smoking - that is why we are committed to working alongside our partners in the NHS to provide every support possible to assist them."
The SPS will work with other agencies to help to provide support to those who wish to quit smoking.
The sale of tobacco in prisons will cease in 2018 and the SPS will seek to make changes to prison rules to make smoking in Scotland's prisons illegal.
Health secretary Shona Robison said: "Smoking remains the biggest single cause of preventable ill-health and premature death in Scotland.
"We have taken wide-ranging action to address this, from our campaigns to take smoking right outside, to measures on tobacco advertising and packaging.
"I endorse this important step by SPS which will contribute towards our ambition of creating a tobacco-free generation by 2034."