EAST HARTFORD, Conn. -- Randy Edsall got his 47th win on Connecticut's home field, but this time he was coaching Maryland.

C.J. Brown ran for 122 yards and a touchdown and threw for 277 yards and another score on Saturday night as the Terps beat UConn 32-21, giving Edsall his first victory over the program he coached for a dozen seasons.

"I guess now I can be the first person to win a game at Rentschler Field as the head coach at UConn and a visiting coach, so I established a record there," he said. "So, I'm glad my guys allowed me to do that."

Stefon Diggs had 110 yards receiving, including a 12-yard touchdown for the Terrapins, who improved to 3-0 for the first time since 2001.

Maryland, which led just 13-10 at the half, put up 501 yards of offense, going over 500 yards for the third straight game.

"C.J. is a big factor for that," said Diggs. "He can run the ball. He can throw the ball. He just brings a lot to the game and that's how we rack up 500."

Brown missed last year, including a 24-21 loss to UConn in College Park, with a knee injury.

"We owed them," Brown said. "That was kind of our mentality, our motivation."

Shakim Phillips caught a career-high 10 passes for 178 yards and a late touchdown for UConn, which fell to 0-2 for the first time since 2002.

Diggs, who caught five balls, had 98 yards receiving at the half. His 12-yard catch and run in the third quarter capped a four-play 80-yard drive in the third quarter that put the Terps up 20-10.

The Huskies cut the lead to 20-13 on a 34-yard field goal that came after Brandon Ross fumbled the ball at his own 25-yard line.

But Dexter McDougle stepped in front of Geremy Davis on the right sideline, and took an interception back 49-yards across the field for a touchdown to give Maryland some breathing room. It was one of two interceptions on the day for the senior cornerback.

UConn quarterback Chandler Whitmer was 29-of-46 for a career-high 349 yards, a touchdown and those two picks. His intentional grounding penalty in the UConn end zone with just under 9 minutes left, put the Terrapins up by three scores, and put the game out of reach.

Brad Craddock added a 40-yard field goal, his third of the game.

Phillips boosted his stats with a late 75-yard touchdown catch and run, but had to be helped off the field after injuring his hamstring on the play.

Maryland, which had 576 and 587 yards in its first two games, put up 319 yards of offense in the first half of this one. But mistakes kept them to just 13 points.

The Terps turned the ball over three times in the first quarter in UConn territory, twice failing to convert on fourth-and-1.

"Today wasn't pretty," Brown said. "We had 500 yards, but we didn't put enough points on the board, and when we were down in the red zone, we were coming away with field goals. We just kept shooting ourselves in the foot and we just can't do that when we go against other teams this year."

Ross was stuffed for a 3-yard loss to end the Terps first possession, and UConn responded by going on a six-play 64-yard drive that ended with Lyle McCombs taking a pile of players into the end zone from five yards out. Ross finished with 95 yards rushing. McCombs had 53 for UConn.

Maryland went for it and missed again on fourth-and-1 from the UConn 23, and in between, Brown was picked off by cornerback Taylor Mack on the Huskies 22.

Maryland got on the board in the second quarter when Brown kept the ball on a read option and went 41 yards up the middle of the Husky defense to tie the game, capping a four-play 80-yard drive.

The teams traded field goals to keep the game tied at 10. Chad Christen's 33-yarder was his ninth consecutive successful attempt.

But the Terps put together a 10-play, 86-yard drive just before halftime, settling for a 21-yard field goal after Levern Jacobs stepped out of bounds on a 48-yard reception just before diving into the end zone.

Edsall was back at Rentschler field for the first time since leaving the program after the 2011 Fiesta Bowl. He built UConn from Division I-AA power to Division I upstart and took the program to five bowl games in his 12 years in Storrs. Connecticut hasn't had a winning season since he left.

The Huskies went 5-7 in Paul Pasqualoni's first season at UConn and opened this season with a 33-18 loss to Towson out of the Football Championship subdivision. No. 11 Michigan visits next week.

"We need some young guys to play better," said Pasqualoni. "We need guys who are playing for the first time to settle down and play better. But we have talent on the team."