The Pentagon inspector general has launched a review to determine whether the U.S. military deployment to the southern border is legal, according to a Department of Defense memo obtained by NBC News.

The review was opened three months after 30 members of Congress requested an investigation into whether the deployment violates a law that prohibits active duty military troops from carrying out law enforcement duties inside the U.S.

In a memo to military leaders, Glenn Fine, the principal deputy inspector general, said the evaluation will look into a range of areas, including the type of activities the troops are doing at the border, the training they received, and the cost of the deployments.

"We intend to conduct this important evaluation as expeditiously as possible," Fine said in a statement.

The Department of Homeland Security didn't respond to a request for comment.

Troop levels at the border, including both active-duty military and the National Guard, have at times surpassed 5,000 since President Donald Trump began deploying them there in the fall of 2018. The current tally is 6,500, a number that will drop once a troop transition is complete, a Pentagon spokesman said.

Rep. Raul Grijalva, D-Ariz., and 29 other members of the Congress wrote to Fine in September expressing concerns over the legality of sending thousands of troops to the U.S.-Mexico border.

“We refuse to allow our servicemembers in uniform to become pawns in the President's unnecessary and dangerous anti-immigrant political agenda," the letter says. "Congress and the American people deserve to know why our military forces are being politicized and whether the U.S. military is violating federal law under the President’s orders."

In a statement released on Tuesday, Grijalva said he welcomed the investigation.

"The military should have no role in enforcing domestic law, which is why Trump’s troop deployment to the southern border risks eroding the laws and norms that that have kept the military and domestic law enforcement separate," he said.

The Pentagon inspector general team conducting the review will include investigators, auditors, and attorneys.