The defender, who joined the Championship side on loan in October, has signed a three-and-a-half-year deal and will now aid the club's bid for promotion to the Premier League
The 23-year-old Spaniard has signed a three-and-a-half-year deal with the Championship outfit after Norwich accepted an undisclosed fee.
Ayala, a former Liverpool trainee, joined Middlesbrough on loan in October and has made 13 appearances for the club so far.
Having mustered only 10 first-team outings in an injury-hit first campaign with Norwich following his arrival from Liverpool in August 2011, Ayala was loaned to Nottingham Forest last season.
He once again struggled for fitness at the City Ground and appeared in only 14 games.
However, Ayala has been able to feature regularly for Aitor Karanka's Middlesbrough, who are seeking a return to England's top flight.