Maryland’s Casey Townsend is tied for third in the nation in scoring. (Joel Richardson/FOR THE WASHINGTON POST)

The goalkeeper, defensive midfielder and central defender had decided to leave the University of Maryland men’s soccer program after last season, foregoing eligibility to embark on pro careers.

The forward could’ve joined them. He had attracted interest from MLS and overseas. He had his coach’s blessing. Instead, he chose to stay.

And with that decision, reached after weeks of deliberation at home in Michigan during winter break, senior Casey Townsend returned to College Park and became one of the nation’s leading scorers this fall.

Enjoying their finest regular season in 43 years, the second-ranked Terrapins (11-0-1) will visit Virginia (6-4-0) on Friday night.

“There’s always that risk of coming back and maybe it not working out,” Townsend said.

It has worked out. Townsend’s 11 goals are second in the ACC and tied for third in the country. With goals against nationally ranked Creighton and Charlotte last week, he was named the ACC and national player of the week. At 37 career goals, he is seventh on Maryland’s all-time list and on pace to claim second place behind Jason Garey (60 from 2002 to 2005).

“There were points where I wasn’t sure what I wanted to do,” he said. “But the opportunity to finish some business that I knew I hadn’t done yet, things I wanted to accomplish, was still out there.”

Make no mistake: Had MLS made a more substantial pitch, Townsend would’ve joined early-exiting teammates Zac MacMath, Ethan White and Matt Kassel.

MacMath, a junior goalkeeper, signed with the league and was chosen by the Philadelphia Union in the first round of the draft. White, a sophomore defender, and Kassel, a junior midfielder, signed directly with D.C. United and the New York Red Bulls, respectively, because they had been affiliated with those clubs’ youth academies.

The league didn’t chase Townsend as aggressively as MacMath, a U.S. under-20 national team regular, and wasn’t planning to offer as much money. Beyond salary, there is significant incentive for non-seniors to sign with MLS: bonuses, a guaranteed contract and stipends to complete their education.

“His parents asked us for help because they were naive to the process,” said Terrapins Coach Sasho Cirovski, who has lost numerous non-seniors to the pros over his 19 seasons. “We spoke with agents, spoke to the league, to figure out where he stood in their plans. MLS certainly wanted to make an offer, but if he wasn’t one of the top three or four guys, he wasn’t going to go.”

Players who stay for a fourth season run the risk of settling for minimum contracts with no guarantees or bonuses. Some elite seniors, however, sign in advance of the MLS draft for higher rates. With the way he has performed this season, Townsend is likely to receive a heftier deal. He also could weigh options in Europe’s lower tiers, as he did last winter.

“You can never turn a blind eye to guaranteed money and a guaranteed spot on the team,” said Townsend, who will graduate this semester with a degree in criminal justice. “But there are opportunities for seniors as well. It was worth the risk.”

Townsend’s decision to stay in school turned out to be a wise one. He has already matched his career high for goals, set as a freshman, and by exhibiting a variety of scoring methods and becoming more efficient with his opportunities, his stock has risen, according to multiple agents.

Cirovski attributes Townsend’s scoring haul, in part, to less pressure. “His mind is free,” he said. “Our sophomores and juniors, their minds get clouded because of the pull of the [MLS early-signing] program with guaranteed contracts and higher income potential.”

Last year, Townsend had nine goals and a career-best five assists as the Terrapins advanced to the NCAA tournament quarterfinals. But, he admitted, he didn’t meet his expectations.

“There was a lot of pressure last year and sometimes that can get to you with all the different rumors going around: ‘Is he going to stay, is he going to go?’ ” he said. “This year I don’t have any distractions. I know this is my last year, these are my last games, so I’m putting it all out there. I’m playing as free as I’ve ever played.”

Townsend has combined with junior midfielder John Stertzer and sophomore forward Patrick Mullins for 25 of the team’s 31 goals.

“He definitely wanted to go [to the pros], yet there was also part of him that wanted to stay,” Mullins said. “He was in two different worlds. He wasn’t sure what he wanted to do with it, but you can see he’s happy he stayed.”