Syfret returned to "Ramillies" in late April as a rear admiral, commander of the covering force for the invasion of Madagascar (Operation Ironclad). The ship provided a landing party of 50 Royal Marines that were ferried by the destroyer at high speed past the coast defences of Diego Suarez on the northern end of Madagascar in the dark on 6 May. Disembarking in the harbour, they captured the French artillery command post along with its barracks and the naval depot. The following day the battleship engaged the coastal batteries on Oronjia Peninsula, but after enduring a few salvos of 15-inch shells, the French gunners decided to cease firing. "Ramillies" remained there during the Battle of Madagascar until the French garrison surrendered in November. On 30 May, Japanese midget submarines that had been launched by the submarines and attacked the ships in Diego Suarez. One of the midget submarines scored a hit on "Ramillies" just forward of her "A" turret on the port side. The explosion tore a large hole in the hull and caused extensive flooding, though damage control teams quickly contained it and prompt counter-flooding prevented her from listing badly. Still down by the bow after offloading most of her ammunition, she was nevertheless able to steam to Durban, South Africa, at a speed of . There, she was inspected by the Constructor H. S. Pengelly, who noted that "although the vessel is now 26 years old and felt by most to be of little value owing to reduced size and slow speeds, the "Ramillies" is in exceptionally good shape, and I should wonder whether or not the capital ships of today with their lighter scantlings would survive a blow as well as this old girl, some 26 years after they were built."