The Town-class light cruisers were designed as counters to the Japanese Mogami-class cruisers built during the early 1930s and the last batch of three ships was enlarged to accommodate more fire-control equipment and thicker armour. Gloucester displaced 9,400 long tons (9,600 t) at standard load and 11,650 long tons (11,840 t) at deep load. The ship had an overall length of 591 feet 6 inches (180.3 m), a beam of 62 feet 4 inches (19.0 m) and a draught of 20 feet 7 inches (6.3 m). She was powered by four Parsons geared steam turbine sets, each driving one shaft, which developed a total of 82,500 shaft horsepower (61,500 kW) and gave a maximum speed of 32 knots (59 km/h; 37 mph). Steam for the turbines was provided by four Admiralty 3-drum boilers. The ship carried a maximum of 2,075 long tons (2,108 t) of fuel oil which gave her a range of 6,000 nautical miles (11,110 km; 6,900 mi) at 14 knots (26 km/h; 16 mph). The ship's complement was 800–815 officers and ratings.
The Town-class ships mounted eight BL six-inch (152 mm) Mk XXIII guns in four twin-gun turrets. The turrets were designated 'A', 'B', 'X' and 'Y' from front to rear. Their secondary armament consisted of eight QF four-inch (102 mm) Mk XVI dual-purpose guns in twin mounts. Their light anti-aircraft armament consisted of a pair of quadruple mounts for the two-pounder (40 mm) AA gun ("pom-pom") and two quadruple mounts for 0.5-inch (12.7 mm) Vickers AA machine guns. The ships carried two above-water, triple mounts for 21-inch (533 mm) torpedoes.
The Towns lacked a full-length waterline armour belt. The sides of Gloucester's boiler and engine rooms and the sides of the magazines were protected by 4.5 inches (114 mm) of armour. The top of the magazines and the machinery spaces were protected by 2 inches (51 mm) of armour. The armour protecting the main gun turrets had a thickness of 1–2 inches (25–51 mm).
Gloucester, the ninth ship of her name to serve in the Royal Navy, was laid down on 22 September 1936, launched on 19 October 1937 and completed on 31 January 1939. The ship was then assigned as the flagship of the 4th Cruiser Squadron (CS) on the China Station, where she served until the beginning of World War II in September. In mid-November, Gloucester and the French aviso Rigault de Genouilly were assigned to patrol the Indian Ocean between Madagascar and the Seychelles in an unsuccessful search for the German commerce raider Admiral Graf Spee. In December, she was transferred to Force I at Simonstown, South Africa, where she fruitlessly patrolled the South Atlantic against other commerce raiders.
The ship was transferred to the 7th Cruiser Squadron of the Mediterranean Fleet at Alexandria, Egypt, in May 1940. A few days after Italy joined the war on 10 May, Gloucester and her sister ship, Liverpool, bombarded Tobruk, Libya, sinking a small auxiliary minesweeper on the 12th. Several weeks later, the 7th CS was covering several convoys to and from Malta when British Short Sunderland flying boats spotted an Italian convoy on the 28th. The squadron was ordered to intercept and sank the destroyer Espero with a prodigious expenditure of ammunition.
On 7 July, the Mediterranean Fleet sortied to cover more Malta convoys, but they were spotted by the Italians that evening. The next day, a bomb dropped by Savoia-Marchetti SM.79 bombers struck the ship's bridge, killing 18 crew members instantly, including the captain. As a result of the attack, the ship could not be steered from the bridge and was uncontrolled for a time before the aft steering position could take over. Despite an inoperable bridge, the ship remained with the fleet and participated in the Battle of Calabria on the 9th, although she was ordered away from the battleline to escort the aircraft carrier Eagle. Repairs were completed by the end of August when Gloucester, now assigned to the 3rd Cruiser Squadron, participated in Operation Hats. At the end of September, the ship ferried 1,200 troops to Malta, together with Liverpool. Gloucester spent most of the rest of the year escorting convoys to and from Greece and Malta, although she escorted the aircraft carrier Illustrious during the Battle of Taranto on 11 November and ferried troops to Piraeus, Greece, on the 17th.
On 11 January 1941, while supporting Operation Excess (several coordinated convoys), Gloucester and sister ship Southampton came under attack from Junkers Ju 87 "Stuka" dive bombers from StG 2 while leaving Malta. Gloucester was hit by a 250-kilogram (550 lb) bomb which failed to explode after penetrating through five decks. Southampton was hit by at least two bombs and caught fire; heavily damaged and without power, the ship was scuttled by torpedoes from the light cruiser Orion.
On 27 March, Gloucester, now reassigned to the 7th CS, departed Piraeus bound for Souda Bay, Crete as part of Vice-Admiral Andrew Cunningham's plan to trap and destroy a large portion of the Italian Fleet which was at sea in an attempt to intercept British convoys operating between Greece and Egypt. British signals intelligence had revealed the Italian plan and Cunningham attempted to consolidate his ships, but was delayed and missed his rendezvous with the 7th CS scheduled for the following morning. The Italians located the squadron first and the 3rd Cruiser Division with three heavy cruisers, escorted by three destroyers, opened fire at 08:12 at very long range. Only Gloucester returned fire as the British attempted to disengage, but the Italians followed, against orders, when Admiral Angelo Iachino recalled them at 08:55. The 7th CS turned around to observe the Italian manoeuvre and Iachino attempted to pincer the British cruisers between his 3rd Cruiser Division and his flagship, the battleship Vittorio Veneto. Although Vice-Admiral Henry Pridham-Wippell knew that the Italians had a battleship at sea, he was still caught by surprise when Vittorio Veneto opened fire at 10:55 at Orion. The 3rd Cruiser Division joined in shortly afterwards, but gunnery problems plagued the Italians and they scored no hits against their primary targets, Gloucester and Orion. The British ships laid smoke screens and turned south towards the main body of the Mediterranean Fleet. An unsuccessful attack by torpedo bombers from the aircraft carrier Formidable persuaded Iachino to turn back at 11:40. The 7th CS was able to keep up the pursuit that afternoon after another torpedo bomber attack damaged the Vittorio Veneto at 15:20 and reduced her speed. A subsequent attack crippled the heavy cruiser Pola and Orion's radar picked up Pola, and the two other heavy cruisers that had been sent to her assistance, at 20:15. Cunningham's three battleships quickly sank all three heavy cruisers at point-blank range later that night.
Gloucester repeatedly bombarded targets in Libya during April. After covering another convoy to Malta, the ship, together with the battleships Warspite, Valiant, and Barham, and various destroyers, attacked Tripoli harbour on the night of 20/21 April with some success. At the end of the month, the ship was briefly transferred to Force H at Gibraltar before escorting a convoy eastward to Malta and rejoining the Mediterranean Fleet in Operation Tiger in early May.
After German paratroopers landed on Crete on 20 May, Gloucester was assigned to Force C that was tasked with interdicting any efforts to reinforce the German forces on the island. On 22 May, while in the Kythira Strait, about 14 miles (12 nmi; 23 km) north of Crete, she was attacked by "Stuka"s of StG 2 shortly before 14:00, together with the light cruiser Fiji and the destroyer Greyhound. The latter was sunk and the two cruisers were each hit by 250-kilogramme bombs, but not seriously damaged. Two other destroyers were ordered to recover the survivors while the two cruisers covered the rescue efforts. Gloucester was attacked almost immediately and sustained three more hits and three near-misses and sank. Of the 807 men aboard at the time of her sinking, only 85 survived.
The circumstances of the sinking were featured by a BBC programme. According to this, the despatch of Gloucester, alone and low on fuel and anti-aircraft ammunition (less than 20% remaining), into danger was a "grievous error". Furthermore, the failure to attempt to rescue survivors after dark was "contrary to usual Navy practice". A survivor commented "The tradition in the Navy is that when a ship has sunk, a vessel is sent back to pick up survivors under cover of darkness. That did not happen and we do not know why. We were picked up by Germans." On 30 May 1941, in a letter to the First Sea Lord, Sir Dudley Pound, Cunningham wrote, "The sending back of Gloucester and Fiji to the Greyhound was another grave error and cost us those two ships. They were practically out of ammunition but even had they been full up I think they would have gone. The Commanding Officer of Fiji told me that the air over Gloucester was black with planes."
The ship's wreck is a controlled site under the Protection of Military Remains Act 1986. Amongst the crewmen lost was the former Southampton footballer Norman Catlin.