The U.S. military suffered a rash of aviation incidents just as President Trump ordered the National Guard deployed to the border with Mexico, raising questions about whether the mission will strain funding the Pentagon relies on to prevent such accidents.

Five people died in four U.S. military air crashes in less than two days this week, just as the White House announced plans to bring in military might from the National Guard in its effort to secure the border.

Defense Secretary Jim Mattis has said his top priority is ensuring that the military is as lethal as possible and ready to fight, which means guaranteeing stable funding for training, equipment and maintenance that commanders hope will reduce the number of aviation accidents.

Trump’s decision to enlist the Pentagon in his effort to secure the border could strain the funds Mattis wants to dedicate to ensuring troops are ready and trained.

While the military has been careful not to say that funding levels are directly causing deaths, the services have regularly said that they need more money to train pilots properly, replace and repair aging aircraft and give maintenance personnel the skills to maintain those planes.

Marine Corps Commandant Robert Neller said in a hearing in early March that the service is increasing flying hours for its pilots and stepping up training for maintainers of the aircraft. He said that of the 12 Class A incidents the Marine Corps experienced last year, the material condition of the aircraft was not “part of the event” in almost all the cases.

Pentagon spokeswoman Dana W. White said Thursday that the administration hadn’t decided where the Defense Department would get the funds for Trump’s National Guard deployment. But she said it wouldn’t take away from Mattis’s mission to shore up training and maintenance programs that top military officials say suffered for years as a result of congressional budget caps.

“Border security is national security, and we are leaning forward to support the president in his intent and his goal, but readiness remains our top priority,” White said. “I can assure you that our resources will still be dedicated to our war fighters.”

The Pentagon will set up a special operations cell that will coordinate the effort to secure the border with the Department of Homeland Security, she said. She added that the military first must receive the requirements for the mission before deciding on funding sources, troop numbers and a timeline for deployment.

Rep. Mac Thornberry (R-Tex), chairman of the House Armed Services Committee, said in an interview with a Texas newspaper before the White House announced the border deployment that he didn’t want to see border security efforts draw on funds needed to rebuild the U.S. military.

“I fully support doing more at the border,” Thornberry said in an interview with the Wichita Falls Times Record News. “But we don’t need to rob the military.”

Thornberry, working alongside Mattis, has led the effort to increase funding for the military. The latest omnibus spending bill included $47.4 billion to upgrade old aircraft, replace broken aircraft and recruit and train more airmen and mechanics. Thornberry’s committee said the funding was needed because, due to maintenance and spare parts issues. fewer than half the Navy’s aircraft can fly, and 80 percent of Marine aviation units lack the minimum number of ready basic aircraft.

The Pentagon has drawn upon its operations and maintenance budget to deploy the National Guard to the border in the past.

President George W. Bush sent the National Guard to the border with Mexico from 2006 to 2008 in a deployment that cost a total of $1.2 billion, including operations and maintenance costs of $120 per person per day, according to the Government Accountability Office. At the time, the Pentagon reprogrammed operations and maintenance funding from the Air Force and Navy Reserve to help pay for the deployment.

The four military aircraft accidents this week reignited concerns about possible insufficient training, maintenance and equipment. The Trump administration and Republican-controlled Congress have lifted budget caps and stepped up funding for military readiness.

Three of the four incidents involved aircraft from the Marine Corps, which has been reeling from an increase last year in the number of so-called Class A mishaps — accidents that cause upward of $2 million in damage, fatalities or permanent disability for people on board.

A Marine CH-53E Super Stallion helicopter crashed Tuesday afternoon during a routine training mission near El Centro, Calif., killing all four crew members on board.

The same day, during an exercise in the East African nation of Djibouti, another Marine CH-53 helicopter was damaged on landing and a Marine AV-8B Harrier jump jet crashed after the pilot ejected. U.S. Naval Forces Central Command canceled the remainder of the exercise in response to the incidents, which didn’t result in any fatalities.

On Wednesday morning, an Air Force pilot was killed when his F-16 fighter jet crashed over a training range in Nevada. The pilot was a member of the elite Thunderbirds, a flying aerobatic squadron that appears around the world.

The Air Force canceled the Thunderbirds’ participation in an upcoming air show in California and said it was unknown how the accident would affect the remainder of the team’s 2018 season.

The accidents come as the Pentagon grapples with a spike in crashes. A Marine KC-130T transport plane crashed in Mississippi last summer, killing 15 Marines and a Navy sailor. It was the worst accident for the service in more than a decade.

Speaking at the Center for Strategic and International Studies in January, Marine Commandant Robert Neller said the service had a “horrible year last year” and emphasized that pilots needed more training hours and updated equipment.

In a briefing Thursday, Marine Lt. Gen. Kenneth F. McKenzie Jr. rejected the idea that the U.S. military was undergoing a wave of incidents or experiencing an aviation crisis.

“One mishap is too many. But I’m not prepared to say right now that this is some sort of a crisis,” McKenzie said. The military will investigate each crash and determine whether they were isolated incidents or part of a systemic problem, he said.