While far from the major battlefields of the American Civil War, Texas contributed large numbers of men and equipment to the rest of the Confederacy. Union troops briefly occupied the state's primary port, Galveston. Texas's border with Mexico was known as the "backdoor of the Confederacy" because trade occurred at the border, bypassing the Union blockade. The Confederacy repulsed all Union attempts to shut down this route, but Texas's role as a supply state was marginalized in mid-1863 after the Union capture of the Mississippi River. The final battle of the Civil War was fought near Brownsville, Texas at Palmito Ranch with a Confederate victory.