For some people, going to prison can mean better access to health care than on the outside.
Most people leaving prison were happy with the health care they received in jail, an Australian Institute of Health and Welfare report has found.
More than half said their physical health improved in jail, while a third reported it stayed the same.
AIHW spokesperson Anna Ritson said many adults entering prison came from disadvantaged backgrounds.
"For some people from disadvantaged backgrounds, prison can provide better access to health care and health professionals than they experienced in the community," she said on Thursday.
"Prison clinics can greatly help people in prison take steps to improve their health, such as quitting smoking or getting help with mental health issues.
"However, these health improvements can be lost after people are released, especially if health care and support services are not available during their transition to and within the community."
The AIHW report said many types of health care were accessed less often in the community than in prison for reasons including cost, work or family commitments and alcohol or drug issues.
It said providing and operating health services in a prison environment was not always straightforward, noting the continuity of care between jail and the community could be difficult.
The AIHW said people entering prison were unlikely to have seen a doctor recently, while just over half were unemployed and a third were homeless in the month before being imprisoned.
It said mental health conditions were common among prisoners, but noted that for some people, interaction with the justice system might be the first time a health professional has assessed their mental health.
Almost two-in-five prison dischargees reported their mental health improved while in jail.
The AIHW noted, however, that people leaving prison are estimated to have a risk of suicide more than six times greater than that of the general population.
The health of Australia's prisoners 2018 report found 73 per cent of people entering prison had previously been in jail.
Australian Associated Press