ARLINGTON, Texas — Derrick Henry strode across the Ravens’ locker room Sunday night inside AT&T Stadium with his chest out and a wide smile stretched across his broad face. The 6-foot-2, 247-pound running back, clad in a sleeveless T-shirt and still wearing his pants and cleats, then leaped into the arms of 6-8, 380-pound right guard Daniel Faalele, who was already dressed and showered. Two large men, one giant embrace.

They had heard the noise, and now they were celebrating in a quiet, disappointed building full of Cowboys fans with relief.

After two straight losses and two straight weeks of biting criticism — of the offensive line and of blown chances — the Ravens had their first victory of the young season, a 28-25 nail-biter over Dallas. It should have never been that close in the end, but the win was thanks in large part to some of Baltimore’s biggest players, literally and figuratively.

Henry, who had mostly struggled to get going the past two weeks, had 151 yards on 25 carries and two touchdowns to lead the Ravens’ gashing ground attack, while quarterback Lamar Jackson rushed for 87 yards and a touchdown and completed 12 of 15 passes for 182 yards and another score to avoid the franchise’s first 0-3 start since 2015.

“They came out with a mindset of moving guys off the line of scrimmage, being physical and playing the Ravens’ style of football,” said Henry, who specifically shouted out each of the team’s five starting offensive linemen in his postgame news conference. “I think they did a great job of that today. For me to have success, I told them before the game, ‘When y’all go, I’ll go.”

They had to hang on in the end, despite building a 22-point lead in the second half and heading toward a blowout that never came.

First, Baltimore failed to recover an onside kick with just under nine minutes remaining in the fourth quarter. Then there appeared to be a coverage bust that left wide receiver Jalen Tolbert wide-open in the end zone and Cowboys quarterback Dak Prescott hit him for a 15-yard touchdown to cap a seven-play, 56-yard drive. That cut the deficit to 28-18 after a failed 2-point conversion.

The Ravens went three-and-out on their next possession, were flagged for pass interference and roughing the passer on Dallas’ next series, and the Cowboys took advantage. Dallas marched 91 yards in 11 plays with Prescott finding KaVontae Turpin for a 16-yard touchdown in the back of the end zone to cut the deficit to 28-25 with 2:58 left.

But staring at a third-and-6 from his own 25-yard line with 2:36 remaining, Jackson connected with wide receiver Zay Flowers for 9 yards to give Baltimore a first down.

Then with two minutes remaining and with the Cowboys out of timeouts, Jackson shot through the left side of the line on a run-pass option for a 10-yard gain to end any chance of a comeback.

“I just had to make a good read in the hole,” said Jackson, who gave an impassioned speech at the half about the need to finish drives off, something that has plagued the Ravens each of the first three weeks. “Offensive line did a tremendous job of getting me a lane to get that first down.”

The same couldn’t be said about the Ravens’ ability to close out a game that shouldn’t have come down to the final minutes. But penalties (13 for 105 yards), missed tackles and just 7 second-half points by Baltimore allowed the Cowboys to climb back.

“We need to eliminate the penalties,” coach John Harbaugh said. “They’re hurting us, they’re costly.”

At least this time didn’t cost them the game.

“We definitely need to finish better,” veteran left tackle Ronnie Stanley said. “We’re happy coming away with the win, but we know we’re a lot better than how we finished that game.

“When it comes down to having the lead, keeping the lead and extending it when we really need to, we’re just not doing it right now. That’s what we need to figure out.”

For the first half and then some, the Ravens had.

Dallas trailed 21-6 at the half, an all-too-familiar sight for the home crowd. In the first half of its past four home games, the Cowboys have been outscored by 54 points.

After Baltimore racked up 272 total yards in the opening 30 minutes — including 111 rushing — they continued to pound Dallas, running the ball five straight times for 70 yards and a touchdown on the opening series of the third quarter. Henry did most of the damage, ripping off a 29-yard gain and then scoring from 26 yards out to make it 28-6.

Others had contributed too, with wide receiver Nelson Agholor juking a defender after a short pass and racing 56 yards down the right sideline to Dallas’ 1-yard-line to help set up Baltimore’s second touchdown of the opening quarter. That, after tight end Charlie Kolar, rarely used in the passing game, rumbled 30 yards after catching a short pass to set up the Ravens’ first score.

But mostly, Baltimore took it to Dallas on the ground. Wisely so.

A week after the Cowboys surrendered 190 rushing yards in an embarrassing 44-13 loss to the New Orleans Saints, they were torched for 191 by early in the third quarter as the Ravens finished with 274 yards on the ground.

Baltimore’s defense, meanwhile, was equally dominant — through three quarters, at least.

The Cowboys were held to 169 yards in the first half, including just 32 rushing, but finished with 412 after a wild fourth quarter in which they reached the end zone three times in six minutes and racked up 211 yards. Prescott, who was sacked twice and pressured through much of the first half, finished 28 of 51 passing for 379 yards and two touchdowns, while All-Pro receiver CeeDee Lamb had only four catches for 67 yards.

Baltimore had allowed an opposing receiver to record more than 100 yards in each of the first two games and entered Sunday ranked 31st in the league in passing defense, having allowed 11 plays of 20 or more yards. Those struggles reared their head again in an ugly fourth quarter.

That included another missed kick from Justin Tucker, who missed a 46-yarder wide left with 10:44 to go.

“We’ve got to finish,” Jackson said. “I didn’t like how things were going; we were getting off the field. I believe [that] we shouldn’t be putting ‘Tuck’ on the field around that time. We should have been punching the clock in right there.

“We’re up, 28-6; the game is not over. We’ve been in those situations years in the past — when we go up [to] halftime, come back, and we lose [after] we’re up 35-14 and stuff like that. I believe [that] we’ve just got to keep doing what we’re doing [from] the first half [and] just keep putting our guys on the [field] and keep the defense guessing. I believe that we’re going to be in these situations.”

At least the Ravens’ much-maligned offensive line — which didn’t have any changes to the starting lineup despite Harbaugh hinting at it on Friday — held its own, and then some.

In addition to clearing the way for a punishing ground assault, they kept Parsons at bay most of the afternoon as the two-time All-Pro had just five tackles, one quarterback hit and no sacks. The rest of the Cowboys were also held without a sack.

“To finish out that way was really important to win the game on offense at the end,” Harbaugh said. “To have 274 yards rushing and have Lamar take over the game the way he did, to me that’s our identity. We just gotta keep building on that and do everything better.”