The death of two Americans serving in Israel’s military in this weekend’s fighting with Hamas in Gaza is not the first time Americans have died while serving in foreign militaries.

Max Steinberg, 24, of California, and Nissim Sean Carmeli, 21, of Texas, were serving in the Israeli army when they died along with 11 other Israeli soldiers over the weekend. At least 60 Palestinians were also killed.

“All of them have joint citizenship,” Maya Kadosh, Israel’s Houston-based deputy consul to the Southwest United States, told The New York Times. “They are very proud. They are not less American when they serve in the army. They are more American. They feel they protect the values of the place they came from, and they also protect the values of the state of Israel.”

Steinberg and Carmeli were not alone in Israel. Today, the Jewish state has one of the largest number of Americans serving in its military, with roughly 1,000 Americans who did not grow up there serving, said Israeli Defense Force (IDF) spokeswoman Lt. Libby Weiss. In total, it has about 4,000 non-Israeli-born troops.

While Israel is a bit of a special case—foreign-born Jews often serve in the Israeli military thanks to that country’s right of return—three other militaries either actively recruit Americans or are open to them. Australia and New Zealand both have programs to fill spots in their militaries by active-duty or veteran service members, and the French Foreign Legion is legendary for taking almost anyone who shows up at their recruitment offices outside Paris. (Sgt. Bowe Bergdahl reportedly tried to join the Legion before enlisting in the U.S. Army.)

But estimating the number of Americans serving in foreign militaries is fiendishly difficult, since it includes both U.S. citizens serving in the aforementioned militaries and dual-citizens serving in the militaries of the other countries. A State Department official said the department doesn’t track who is serving in foreign armies.

Dual citizenship can sometimes complicate things for traveling Americans, though. There have been several instances of 18-year-old men vacationing in ye olde country and then finding out they’re responsible for national service there. In 2004, a Korean-American man, born in the United States, was teaching English outside Seoul when he was drafted into the South Korean army for two years after he failed to fill out his paperwork renouncing his Korean citizenship before his 18th birthday. He was stopped while trying to return to the U.S. and conscripted.

While forced conscription of Americans is rare, the practice of volunteering has a storied history. Before the United States joined the Allies in WWI, a number of Americans joined the Canadian army to get in on the action. During the 1930s, the Abraham Lincoln Brigade in the Spanish Civil War was made up exclusively of Americans fighting against the fascists. By the time of Pearl Harbor, more than 6,000 U.S. citizens were serving in the Royal Canadian Air Force and 10,000 in the Canadian Army, according to Col. Stanley W. Dzuiban, author of Military Relations Between the United States and Canada, 1939-1945.

For the most part, this is all legal. Prior to 1967, Americans risked losing their citizenship if they joined a foreign military or even voted in a foreign election. That year, the Supreme Court decision in Afroyim v. Rusk established that citizenship is a constitutional right and can’t be stripped involuntarily. So, you’re free to join up with whatever military that will take you, as long as you don’t engage in active hostilities against the U.S. What is illegal is recruiting within the U.S. So, traveling to Israel to join is OK, but the IDF won’t be setting up next to the U.S. Army recruiting station in Times Square any time soon.

Of course, non-state actors, such as al Qaeda, ISIS, the FSA, Libyan rebels, etc. accept Americans, but that’s frowned upon by the State Department.

One peril while serving in a foreign military: the possibility of committing war crimes. Chuckie Taylor, son of Liberian warlord Charles Taylor, was an American citizen who was convicted in 2008 in Florida for torture in the Liberian civil war. He was the first American convicted on U.S. soil for crimes against humanity in another country.

And let’s not even get into the case of John Walker Lindh, the “American Taliban,” currently serving time after being captured in Afghanistan in 2001. His family argued in his trial that he only joined a foreign military, the Taliban, and didn’t intend to fight the U.S., but that didn’t fly.

The U.S. military likewise is open to non-citizens, with all active-duty personnel able to file for citizenship immediately and receive expedited treatment from the U.S. Citizenship and Immigration Services. From September 2002 to May 2013, almost 90,000 members of the Armed Forces gained citizenship.