The right-back has penned a one-year deal with the Championship club after Jambos manager Craig Levein indicated that the player would find first-team chances limited at Tynecastle.
The 22-year-old is a product of Hearts’ youth system, but failed to establish himself at senior level despite making 38 appearances for the club. He spent the whole of last season on loan at St Mirren, helping them win the Championship title.
Ayr manager Ian McCall said: “We have been working on this with Hearts for the last few weeks. He comes very highly rated and he fits exactly the profile of our player we want at this club.
“He is young and hungry to improve. I have spoken to several very well-known managers and they speak very highly about his attitude, so we are very much looking forward to working with him and giving him the platform to improve.
“There are a lot of factors to thank in getting this deal done – the board of directors for the backing but also the attendance for the game against Partick, the increase in season tickets and also the AU500fund.”
Hearts said in a statement on their website: “The club would like to thank Liam for his time spent at Hearts and wishes him well at Ayr United.”