A dramatic rescue mission ensued after emergency services were alerted to the man who had fallen into the River Esk at Eskbank Woods, Dalkeith at about 3.50am on Tuesday morning.
The fire service sent a rope rescue team to the scene and managed to pull the man to safety.
Edinburgh news: Emergency services called to street in Capital after bin lorry hits block of flats
Edinburgh weather: Here is when the storm is set to hit the Capital and the Lothians today
St James Quarter: Video shows leaking in Edinburgh's new shopping centre as a storm set to hit the Capital
A71 crash: Edinburgh commuters face delays after ‘serious’ two-vehicle crash at Dalmahoy Junction
East Lothian crime news: Woman taken to hospital after serious assault in Musselburgh
A witness at the scene said: “As I passed on way to work at 4.30am there were five fire engines, four ambulances and two RIB boat rescue teams.”
A Scottish Fire and Rescue Service spokesperson said: “We were alerted at 3.48am on Tuesday, July 20 to reports of a person in difficulty at Eskbank Woods, Dalkeith.
“Operations Control mobilised four appliances and a number of special resources, including rope rescue teams, to assist with the rescue of a man who had fallen down an embankment.
“The casualty was handed into the care of the Scottish Ambulance Service.
“Crews left after making the area safe.”
Scottish Ambulance Service has been contacted for comment.