Federal officials deliberately crashed a malfunctioning drone into the Pacific Ocean off the coast of San Diego overnight.

The drone belongs to U.S. Customs and Border Protection, which has now grounded its entire fleet of 10 drones as a precaution.

The U.S. Coast Guard recovered debris left by the drone approximately 20 miles southwest off Point Loma.

According to customs officials, the drone flew out of Arizona and was piloted by a crew in Texas overseen by agents in Washington, D.C.

The Predator B drone that crashed was a variant called the Guardian, which was specially equipped to fly over water.

U.S. Customs and Border Protection spokesperson Mike Friel told the Associated Press that the crash happened around 1:15 a.m. PT Tuesday.

According to customs officials, the crew operating the drone from Texas noticed a mechanical failure and had little time to take action. They decided the safest move was to crash it into the ocean.

Friel said the cause of the mechanical failure is unknown.

Crews are working to recover the $12 million drone. Tuesday afternoon, some of the parts had already been loaded onto a truck at Coast Guard Station San Diego.

These drones are equipped with radar to help officers spot panga boats and semi-submersible vessels used by drug cartels.

"The aircraft can be used to monitor that vessel while other units are dispatched to intercept that vessel," Friel said in an interview with NBC 7 San Diego. "That aircraft can keep eyes on and help individuals who are tasked with intercepting that vessel to know what they're facing."

The Coast Guard report was filed at 11:20 p.m Monday, according to a spokesperson.

The U.S. has been using Predator B unmanned aircraft along the coast of California since 2006 to intercept potential terrorists and illegal border activity. They can fly for 20 hours and as high as 50,000 feet. This is the first time a drone has gone down since the unmanned aircraft program started, according to customs officials.

The FAA and NTSB will investigate the crash.

The drones are made by General Atomics Aeronautical Systems, based in San Diego. The company recently touted the use of its drone technology and its use to help recover a missing mountain biker in New Mexico.

In November, two sailors were injured and a missile cruiser damaged in a drone mishap off the coast of Point Mugu, Calif. USS Chancellorsville was struck by the unmanned aircraft during radar testing, officials said.