AP

It wasn’t always pretty, but the end result is for the Cowboys.

Dallas cliched the NFC East with a 27-20 victory over the Buccaneers on Sunday.

The Cowboys gained only 232 yards, struggling for the second consecutive week. They gained only 292 yards in a 23-0 shutout at Indianapolis in Week 15.

But the Cowboys offense got a big assist from its defense Sunday, with a Jameis Winston fumble returned for a 69-yard touchdown by Jaylon Smith and a fumble return by Randy Gregory to the Tampa Bay 4. Dallas scored two plays after Gregory’s recovery of a fumbled snap by Winston, with Michael Gallup catching a 4-yard pass from Dak Prescott.

The Cowboys also had a 5-yard field-goal drive with Brett Maher‘s 59-yard field goal set up by a 13-yard Cole Beasley punt return.

Gregory had the best game of his career with two tackles, a sack, two quarterback hits, a forced fumble and a fumble recovery.

The Cowboys also had a fourth-quarter goal-line stand, stopping Winston on a fourth-and-goal scramble from the Dallas 7.

Prescott completed 20 of 25 passes for 161 yards and a touchdown. Rookie Michael Gallup caught three passes for 53 yards and at touchdown, while Amari Cooper had only four catches for 20 yards.

Ezekiel Elliott rushed for 85 yards on 18 carries.

Winston, who had the two lost fumbles, completed 34 of 48 passes for 336 yards and a touchdown to Mike Evans.