With the outbreak of war with Japan, Naval movements in the waters around Java increased. On 27 February orders were given to clear all remaining British auxiliary craft from Batavia (now Jakarta). H.M.S. Anking under the command of Captain J P L Reid sailed in convoy for Tjilatap at midnight along with the tanker Francol and minesweeper MMS51, escorted by H.M.S. Yarra and the Indian sloop HMIS Jumna. Arriving off Tjilatjap at 11 am on 2 March, the ships were warned not to enter harbour., and the convoy was ordered to proceede ro freemantle at full speed as powerful Japanese forces were known to be operating in the waters south of Java.
Steaming steadily southeast at an average speed of 8.5 knots, the convoy made steady progress during the night of 2-3 March. Except for a faintly discerned shadowing aircraft sighted in the evening, there was no sign of the enemy. On the morning of the third two lifeboats were sighted. From these, Yarra picked up a number of exhausted survivors of the Dutch merchant ship Parigi, sunk by the Japanese two days earlier.
At 6.30 am on 4 March, as the sun rose the lookout in Yarra sighted the unmistakable topmasts of a Japanese heavy cruiser squadron to the north-east. The squadron consisted of Atago, Takao and Maya, each armed with ten 8-inch guns, and two destroyers. Immediately Lieutenant Commander Rankin made a sighting report, ordered the ships of convoy to scatter and, placing his ship between them and the enemy, laid smoke and prepared to engage. Yarra was outgunned and out-ranged, and the enemy ships were faster. Against such odds her task was hopeless, yet she kept fighting even as her convoy was overwhelmed and sunk, ship-by-ship.
H.M.S. Anking, which was carrying many RAN personnel was sunk first. Overwhelmed by many hits she was despatched in ten minutes. By then Yarra was on fire and listing heavily to port but still shooting. MMS 51 was on fire and was put down shortly after by a hail of close range automatic gunfire from one of the cruisers. The Francol took more punishment and still remained afloat, finally succumbing at about 7.30. Yarra, shattered by numerous hits, was the last to go. Soon after 8.00 am, Rankin ordered that the ship be abandoned. Minutes later he was killed when an 8-inch salvo hit the bridge. Leading Seaman R. Taylor, manning the last remaining gun, kept on firing until he too was killed, and the Yarra's guns fell silent. Her end, which came after close-range shelling by the two Japanese destroyers, was witnessed by 34 survivors on two rafts. All, except the Dutch captain of Parigi, were naval ratings
When Yarra sank, the Japanese made off to the north-east after picking up one boatload of survivors from Francol. A collection of boats, rafts and floats was left scattered over a wide area of sea. Towards evening, a passing Dutch vessel, Tawali, rescued 57 officers and men from Anking. However, in spite of frantic signals, she failed to sight two Carley floats, which held 14 men from MMS 51. For the next two and a half days they drifted about until picked up by the Dutch steamer Tjimanjoek on 7 March. Meanwhile Yarra's men, their numbers sadly reduced by wounds, exposure, and thirst, continued to drift helplessly. On 9 March 13 of the sloop's ratings were picked up by the Dutch submarine KlL..