The Stroke In-Reach project is a pilot developed by NHS Lothian and Edinburgh Leisure and will operate at Edinburgh Royal Infirmary for a year.
Ward-based stroke patients will work with a specialist instructor, Andrew Hebson from Edinburgh Leisure, to rebuild muscle strength and fitness before they return home.
The scheme is funded by the Edinburgh and Lothians Health Foundation (ELHF) and features a gym on the ward.
Mr Hebson said: "I work specifically on improving the impairments that have occurred as a result of the stroke and help accelerate recovery. This is an extremely exciting and rewarding project."