It was long believed that the oldest warship in service was the Russian salvage ship VMF Kommuna. This 2,500 ton catamaran was built in the Netherlands and entered service in 1915. Kommuna began service in the Czar's navy, spent most of its career in the Soviet (communist) Navy and now serves in the fleet of the Russian Federation. Originally designed to recover submarines that had sunk in shallow coastal waters, Kommuna remains in service to handle smaller submersibles, does it well and has been maintained over the decades to the point where it is cheaper to keep the old girl operational than to try to design and build a replacement. While the Kommuna is a navy ship it is not a warship, it is not armed.
The oldest armed navy ship still in service is apparently the gunboat Parnaiba of the Brazilian Navy. Parnaiba is small (720 tons) River Monitor that entered service in 1938. Brazil, with one of the largest river systems in the world (and the second longest river in the world, the Amazon) has long depended on rivers for transportation and has over 22,000 kilometers of navigable rivers. Since many of these rivers pass through thinly populated inland regions Brazil always depended on small river gunboats to back up local law enforcement. The Brazilian Navy still maintains a force of fifteen river gunboats because it still has a lot of rivers that need patrolling.
When the Parnaiba entered service in 1938 it was a modern design and, except for a few years during World War II (Brazil declared war on Germany in 1942 and sent some troops to fight), the only naval threat was German submarines in 1942. Parnaiba was briefly pressed into service as a coastal anti-submarine patrol boat but really was not built for operations in the ocean, even if just coastal waters, and soon returned to river patrols. Over the years Parnaiba has been well maintained and in the 1990s had her steam engines replaced with diesels. Some of her weapons were updated as well along with her electronics. Currently, Parnaiba is armed with a 76mm cannon, two 40mm and six 20mm autocannon as well as two 81mm mortars and some machine-guns and small arms. The ship now has a helipad for medium (up to 10 ton) helicopters. Top speed is 22 kilometers an hour and there is onboard fuel for travelling 2,500 kilometers at 10 kilometers an hour. Supplies are carried to sustain the crew of 74 for 16 days.
Parnaiba became the oldest armed warship in 2011 when the British Royal Navy retired the 4,700 ton HMS Caroline. This light cruiser entered service in 1914 and fought in the epic Battle of Jutland in 1916. Caroline lost most of its heavy guns in the 1920s when many World War I cruisers and destroyers had their heavy guns removed for use as shore batteries. While HMS Caroline still had some weapons and its engines it spent most of its time tied up in port as a headquarters ship. After World War II Caroline served as a training ship, mostly tied up at dockside. When decommissioned in 2011, the ship could no longer move under her own power. At that point it was noted that the Caroline was not the only World War I warship still in service and that Russians were still using the Kommuna, an unarmed support ship. So it was in 2011 that Parnaiba became the oldest armed warship still in service. The U.S. Navy had retired the last of its World War II era armed ships in the 1990s and ships like the Caroline were technically still not “in service” as an armed warship. But the Parnaiba still is and always has been, even though it patrols the world’s largest rivers, not the oceans. In any event, the thousands of Brazilian sailors who have served on the Parnaiba since 1938 all have war stories to tell. The rivers often attracted all manner of criminal activity that the Parnaiba had to deal with. Nothing really epic but there was violence, threats, chases and occasion use of the heavy weapons on board. Parnaiba was armed for a reason and not called a gunboat for nothing.
Most navies would not want to bring attention to their oldest ship, especially if it was nearly a century old. It's different in the American Navy. For example, in 2009 the carrier, USS Kitty Hawk (CV 63) was finally decommissioned and ceased to be the oldest ship in the fleet. The Kitty Hawk served for 48 years and 13 days. In that time about 100,000 sailors served on the ship. The ship was the Navy's last non-nuclear carrier and, since 1998, the oldest ship in commission. "The Hawk" did not age well and had lots of breakdowns in its final years. This led members of the crew to nickname the ship "Shitty Hawk".
When the Hawk became the oldest Navy ship in commission in 1998, it received the First Navy Jack (the Don't Tread on Me flag flown by the first U.S. Navy warships). It's long been customary that the oldest ship in the navy is the only one that can fly the First Navy Jack, and that ship is now the USS Enterprise (which entered service seven months after the Kitty Hawk).
Since September 11, 2002, all U.S. Navy ships have been flying the First Navy Jack and will continue to do so for the duration of the War On Terrorism. So it may be a while before only one ship flies the First Navy Jack. The First Navy Jack moved around a lot in the 1990s, as the U.S. Navy downsized because the Soviet navy had largely disappeared. This process resulted in some very old ships finally getting retired. The USS Prairie, the last of the pre-war US Navy ships that fought in World War II, was decommissioned on 27, March 1993. The ship, a destroyer tender (a supply and maintenance ship for deployed destroyers), entered service in late 1939. The USS Prairie passed the First Navy Jack on to the USS Orion, a submarine tender commissioned in 1944. But the Orion went out of service later that year and the First Navy Jack rapidly moved from one retiring ship to another until the Kitty Hawk got it in 1998, and held on to it for eleven years, an unusually long time. Since 2009 three American warships have been the oldest ship and there are likely to be ships holding the “oldest ship” title for longer periods because the U.S. Navy has decided it would be cheaper to refurbish and extend the useful lives of older warships than building new replacements. The Enterprise was retired in 2012 and the amphibious ship Denver (LPD 9), which entered service in 1968, was the oldest ship until 2014 and succeeded by another amphibious ship the Blue Ridge (LCC-19) which entered service in 1970.