In a news release issued late on Sunday, US Customs and Border Protection officials identified the slain agent as Rogelio Martinez, 36, of El Paso, Texas.
Kevin McAleenan, acting commissioner of CBP, said in a letter sent to border agents that Martinez was unconscious when agents found him, with "multiple injuries" to his head and body. Responding agents provided immediate medical care, and transported both agents to a local hospital.
His partner, who was not named in the statement, was reportedly left in serious condition.
"Our thoughts and prayers are with Agent Martinez and his family, and with the agent who was injured", read the Customs and Border Protection release.
"We are grateful for the courage and sacrifice of our border agents who have dedicated their lives to keeping us safe", Cruz said.
Martinez's partner called for help.
Customs and Border Patrol spokesman Carlos Diaz declined to describe the incident in detail, saying the FBI is investigating.
Mr Trump said the second officer injured on Sunday was "brutally beaten and badly, badly hurt", but "looks like he'll make it".
The NBPC - which says it represents 75% of the 18,000-officer agency - has been a strong proponent of President Trump's border wall.
"The FBI is still actively investigating the incident and gathering the facts", FBI spokeswoman Jeanette Harper said. In his opinion, this is another reason to build walls near Mexico.
They were attacked with rocks about 30 miles (48km) from the Mexico border, according to a labour union for border agents. "I remain fully committed to working with the Border Patrol to provide them with all the resources they need to safeguard our nation", Cruz said.
He also said that what happened on Sunday is a "stark reminder" that an "unsecured border" poses a threat to the safety of the communities and border agents tasked with protecting them.
The Border Patrol's Special Operations Group and agents from CBP's Air and Marine Operations are searching the area for potential suspects or witnesses.
That area has accounted for about one percent of more than 61,000 arrests from October of last year, until May of this year.