QUANTICO, Va. — In a move military analysts call “simply stunning,” the Marine Corps voted in a referendum Friday to leave the Department of the Navy, forming a separate branch tentatively named Men’s Department of the Navy. Defense contractor stocks closed sharply down in the wake of the historic vote.

The results were close, with 51.9 percent voting to leave and 48.1 percent voting to remain. Exit polling data showed the vote split along demographic lines with a slight majority of officers and all Marines from Texas voting to leave. More enlisted favored remaining, especially those with four or more dependents.

The hotly contested vote over what became known as “SemperFuxit” followed months of debate and campaigning from both sides. Though the issue has been debated at Naval Institute Symposia for several years, Marine Corps Commandant Gen. Robert Neller only agreed to hold a Facebook poll on the question

The “Remain” camp fought for the Corps to stay with the Navy, citing the service’s amphibious traditions and the “need for a service to call worthless” while transporting them to battle, sources in Neller’s office say.

However, the “Leave” camp won out, with voters choosing the side that urged the Corps to maintain its tradition to “do more with less,” to include no naval gunfire, transport, medical support, or aviation assets.

Hours after the vote, many Marines in the barracks were Googling “what do those navy POGs even do?” and “how much leave are we getting?” The future of RIMPAC, an annual, major Pacific multinational exercise set to begin next week, is now in doubt.

When asked for comment, Secretary of the Navy Ray Mabus said, “Wait, that really happened? Jesus, how drunk were they?”

Paul Sharpe contributed to this report.