The match also witnessed three red cards in stoppage time, with Milan being reduced to nine men as tensions flared
The Portuguese, on as a substitute, stepped up to bend a right-footed strike beyond Alisson in the 78th minute to book a last-16 tie for his side against West Ham United.
Liverpool looked the more likely winners but it was Fernandes, so often United's spark, who sealed it with his 28th goal in all competitions for the club since his debut last February.
But that was of scant consolation for Liverpool who have now won only once in seven games in all competitions.