After the American Civil War ended in 1865, British and French traders abandoned Egyptian cotton and returned to cheap American exports,[citation needed] sending Egypt into a deficit spiral that led to the country declaring bankruptcy in 1876, a key factor behind Egypt's occupation by the British Empire in 1882.