One soldier finished high school in Texas last year and joined the Army right after graduation. Another lived in Hawaii and served as an air defense artillery officer. Both were mourned on Monday when the Pentagon released their names as the latest U.S. casualties in the war with Iran.

Those soldiers, Pvt. Isabella Gonzales, 19, of Carrollton, Texas, and First Lt. Tyler James Feehan, 25, of Ewa Beach, Hawaii, were killed in action after an Iranian attack in Jordan, Pentagon officials said in a statement.

Lieutenant Feehan was killed on Saturday and Private Gonzales on Friday, the statement said.

The deaths came during a week of spiraling attacks between U.S. and Iranian forces in the Persian Gulf. American forces launched a new round of attacks in Iran on Sunday, according to U.S. Central Command.

Tensions around the Persian Gulf and the Strait of Hormuz have worsened since the collapse of a cease-fire agreement reached by Iran and the United States last month.

Until last week, more than three months had passed since a U.S. service member was known to have been killed by enemy action.

Lieutenant Feehan was assigned to the 32nd Army Air Missile Defense Command in Fort Bragg, N.C., and Private Gonzales was assigned to the 10th Army Air Missile Defense Command in Ansbach, Germany. Both worked in air defense artillery.

Another service member was killed in northern Iraq during the disposal of a downed Iranian attack drone on Saturday, the Pentagon said, but the person’s identity has not been released.

There have now been 17 American military personnel killed since the United States and Israel launched attacks on Iran on Feb. 28.

The Iranian missile barrage that killed Private Gonzales and Lieutenant Feehan at Muwaffaq Salti Air Base in Jordan also left another soldier missing. On Sunday, a U.S. official who spoke on the condition of anonymity because he was not authorized to discuss the matter publicly said that remains at the scene were believed to be those of the missing soldier.

Four American service members wounded in Friday’s attack were taken to Jordanian hospitals and have been discharged, the command said in a statement on Saturday. The command added that more American troops had received minor injuries and had been returned to duty, though it did not specify how many.

On Monday morning, at a tidy brick home in the Dallas suburb of Carrollton where Private Gonzales grew up, her mother answered the door in tears. She was glad her daughter’s name had been made public, she said, but she was not ready to talk about her yet.

An American flag hung from the front of the home. A few other people arrived to be with the family, including several children. “She was a soldier,” Private Gonzales’s uncle, Ricardo Moniz, said, before returning inside. “We’re going to remember her like that.”

Her military occupation, the Pentagon said, was air and missile defense crew member. Those teams work with surface-to-air weapons systems to defend against cruise missiles and other threats, the Army says.

Private Gonzales finished high school — at Hebron High in Carrollton — just over a year ago and joined the Army after graduation. Of the casualties identified by the Pentagon since the war began, she is the youngest service member to be killed. “Her decision to serve after graduation speaks volumes of her character,” a spokesman for the Lewisville Independent School District said in a statement.

Pfc. Galilea Esquivel, who was a roommate of Private Gonzales’s at Fort Sill, Okla., said that they had bonded over their shared love of music, particularly reggaeton and cumbia.

“She was always dancing,” Private Esquivel said. “All the time. Especially if I woke up and I was in a bad mood, she would start dancing.”

She added that Private Gonzales also loved to eat — especially hot Cheetos — and was often on the phone with her mother. “Her mom was like her best friend,” Private Esquivel said, “and she did everything for her.”

The Army said in a statement on Monday that Lieutenant Feehan would receive the Bronze Star, the Purple Heart and the Combat Action Badge, and that he would be posthumously promoted to captain.

The Army describes his role, air defense artillery officer, as someone who leads troops involved with communication equipment systems and radars that protect military personnel from aerial attacks and surveillance.

Brig. Gen. John Dawber, who leads the 32nd Army Air and Missile Defense Command, said that Lieutenant Feehan’s “unwavering dedication to our mission, our values and the air defenders he led will leave an enduring legacy.”

As a child, Lieutenant Feehan occasionally lived with his grandparents in Marietta, Ga., across the street from Kevin Douglas, a childhood friend who was home-schooled. Lieutenant Feehan helped a young Mr. Douglas break into the grade-school social scene, Mr. Douglas said.

When they were boys, Mr. Feehan showed Mr. Douglas how to play poker and introduced him to the wonders of a slumber party. And Mr. Feehan’s grandfather taught them croquet.

Even at an early age, everybody knew Mr. Feehan would join the military, Mr. Douglas said. His father and grandfather both served, “and it seemed like he really looked up to his dad and wanted to be like him,” Mr. Douglas said. “They even looked alike; Tyler always cut his hair short like his dad’s.”

That budding interest in military service showed when the boys were playing video games, like Call of Duty, Mr. Douglas said. They played on the Nintendo Wii, which had a controller shaped like a submachine gun. “He would hold the gun attachment and say, ‘I’m going to grow up and do this.’”

Mr. Feehan was known among friends for his charisma, leadership and competitiveness.

Mr. Douglas hadn’t seen Mr. Feehan in years, but he thinks about him often — more so now that he’s lost his friend.

“He really was the first person to get me out of my shell, and that’s something I’ll never forget.”

Lieutenant Feehan had graduated from Southern Utah University and was just weeks away from earning an M.B.A. from the school, the university said in an email sent to current students, staff and faculty and obtained by The New York Times on Monday.

“Our hearts are with his family, fellow service members, classmates, and all who knew and loved Tyler as we mourn this profound loss together,” Mindy Benson, the university president, wrote in the email. Lieutenant Feehan’s degree will be awarded posthumously and the university plans to honor him in several ways, the email said.

Nick Phillips, an Army first lieutenant, was in the university’s Reserve Officers’ Training Corps program with Lieutenant Feehan and described him as soft-spoken and always willing to help.

“He would always focus on others than himself,” Lieutenant Phillips said.

Senator Mazie Hirono of Hawaii said in a statement that “my thoughts and aloha are with 1st Lt Feehan’s family, and the families of all the brave service members killed and injured in this war.”

Defense Secretary Pete Hegseth said on social media on Saturday that the loss of the two U.S. soldiers would stiffen American resolve. Efforts to reach relatives of both service members were unsuccessful.

In the week leading up to the Iranian attack on Friday, Iran carried out three other strikes against U.S. forces in the country.

Those attacks injured dozens of U.S. service members and damaged several helicopters, according to several U.S. officials, who spoke on the condition of anonymity to discuss operational matters. The Pentagon did not disclose the earlier strikes, nor the casualties associated with them.

The Pentagon has pointed to the Defense Casualty Analysis System as a public source of information regarding dead and wounded U.S. troops. According to the site, 427 U.S. service members have been injured in the Iran conflict. More than 1,700 Iranian civilians have died in the war, according to estimates.

The last known U.S. death from the war was a Navy helicopter pilot who was declared missing after an emergency landing in the Arabian Sea on July 1. The Navy’s Fifth Fleet said the death was not believed to have been caused by enemy action.

Before that, six Army soldiers were killed during a March 1 attack in Kuwait, one service member died of injuries he suffered during a March 1 attack in Saudi Arabia, and six Air Force personnel died when a KC-135 aerial refueling jet crashed in western Iraq on March 12.

John Ismay, Lara Jakes, Eric Schmitt, Gabby Sobelman and Emma Schartz contributed reporting. Kitty Bennett and Sheelagh McNeill contributed research.