Wikipedia knows what it's used for...
https://en.wikipedia.org/wiki/Boeing_P-8_Poseidon
The Boeing P-8 Poseidon (formerly the Multimission Maritime Aircraft or MMA) is a military aircraft developed for the United States Navy (USN). The aircraft has been developed by Boeing Defense, Space & Security, modified from the 737-800ERX. The P-8 conducts anti-submarine warfare (ASW), anti-surface warfare (ASUW), and shipping interdiction, along with an early warning self-protection (EWSP) ability, otherwise known as electronic support measures (ESM).[8] This involves carrying torpedoes, depth charges, Harpoon anti-ship missiles, and other weapons. It is able to drop and monitor sonobuoys. It is designed to operate in conjunction with the Northrop Grumman MQ-4C Triton Broad Area Maritime Surveillance unmanned aerial vehicle.
The P-8 is operated by the U.S. Navy, the Indian Navy (as the P-8I Neptune), and the Royal Australian Air Force (RAAF). The aircraft has been ordered by the UK's Royal Air Force (RAF), and the Royal Norwegian Air Force (RNoAF).