The 23-year-old former Aberdeen and Morton forward moves to Tannadice after scoring 34 goals in all competitions for Ayr United last season.
Manager Robbie Neilson told the club website: "This is a massive signing for the club. A lot of credit must go to the owners, the board and the recruitment staff for the hard work in making this happen.
"We are getting a player who has shown how good he can be at this level and we believe we can make him an even better player with the facilities and coaching that is available at Dundee United."