Arsenal had agreed a contract with the Argentina international but a fee could not be agreed, allowing the striker to complete a move to the Serie A side
Arsenal were in the race for the 26-year-old and had agreed a contract worth £100,000 a week, but an acceptable fee with the Spanish side was not reached.
Napoli have settled a £31.8 million offer with Madrid for Higuain, with the Argentina international signing a five-year, £140,000-per-week deal.
Rafael Benitez, who was appointed as Napoli's new boss in May, targeted Higuain for the vacant striker role which was vacated by Edinson Cavani, who moved to Paris Saint-Germain for £55m earlier in July.
Napoli have already purchased two players from Madrid this summer, with defender Raul Albiol and attacker Jose Maria Callejon moving to Serie A, while Dries Mertens, Pablo Armero, Josip Radosevic, Rafael and Emanuele Calaio have also joined Benitez's side.
Liverpool goalkeeper Pepe Reina also completed a loan move to Napoli earlier this week.