The Kazakhstan-born Brooklyn man who the feds say betrayed America — by becoming a top ISIS sniper in Syria — had come to the US through the diversity lottery, the head of US Citizenship and Immigration Services revealed in an angry tweet.

Ruslan Maratovich Asainov “was born in Kazakhstan on June 28, 1976,” tweeted USCIS Acting Director Ken Cuccinelli.

“He entered the U.S. on a DIVERSITY LOTTERY VISA (!!!) on February 27, 1999, and he became a naturalized U.S. Citizen on September 1, 2006.”

Cuccinelli called the lottery “very dangerous,” and said that both he and President Trump want to see it ended.

“Time for a more merit-focused immigration system w/o dangerous holes like the diversity lottery,” he tweeted.