On October 5, 1804, in peace time, while sailing to Spain in command of four frigates Bustamante was attacked and captured by a British squadron without any declaration of war between U.K. and Spain. He was eventually released and faced a Spanish court-martial, but emerged untainted. That incident supposed that the 14 of December 1804 Spain formally declared the war to Great Britain and allied itself with France in its plan of invasion of Great Britain (Napoleonic Wars).