SAN JOSE, Calif. -- Nick Lima has proven himself to be versatile in his brief career.

The 24-year-old was a forward coming out of nearby Castro Valley, only to switch to right-back following his freshman season at Cal. He even played a bit of center-mid during his senior season before returning to right-back. At the professional level, he's spent most of his time at right-back but has filled in on the left at times for the San Jose Earthquakes.

So when U.S. men's national team manager Gregg Berhalter needed a player to fit into a role that demanded full-back ability in defense and center-mid traits in attack, Lima was more than willing to step in. He then proceeded to excel on both sides of the ball in last Sunday's 3-0 win over Panama, including a laser-guided assist on Walker Zimmerman's goal.

"Nick, I've always admired his skill set, and I like his competitive attitude," said Berhalter earlier this week. "He proved that he's open to trying things, and learning, and he did a great job."

For Lima, it was a case of doing whatever was necessary to get into the lineup.

"It's the national team; you want to be adaptable," he said as he sat in the lobby of the U.S. team's hotel. "I took it as a huge opportunity. 'Oh, you want me to play here? This spot is open in the camp? OK, I'm going to do everything in those two weeks to show my best to get an opportunity to get on the field.'"

There have been moments in Lima's career when he wasn't always so willing. The switch to right-back during his college years was especially challenging. Lima had spent his freshman season in his preferred forward position, only for Cal head coach Kevin Grimes to notice some key aspects of the player's game.

Nick Lima's versatility has proven invaluable as he breaks into the U.S. national team. Robin Alam/Icon Sportswire via Getty Images

"Whenever Nick was facing forward and playing forward, his effectiveness was off-the-scale good," said Grimes via telephone. "You get that guy running at you, look out."

The problem was that part of a forward's life is spent with his back to goal. Given Lima's skill set, Grimes called that "wasted time," so the decision was made to convert him to right-back. Yet rather than look at the ways he could thrive in the role, Lima interpreted the switch as a criticism of his game.

"I didn't take it well," he said of the switch. "There was a point where I felt like I deserved to play forward. There was a lot of denying it at first."

So much so that Lima contemplated giving up soccer and switching back to American football. He had played the sport at Castro Valley High School, juggling his club soccer commitments to play as a running back, slot receiver, cornerback and kicker, and had received a few scholarship offers. A cooler assessment of the opportunity in front of him saw him stick with soccer.

"I thought about it, and I was like, 'What have I trained to do my whole life? What's my first love? Soccer,'" he said. "With this, I was going to learn from it, and I wanted to be a professional, I always have been. From then on, I worked as much as I could and tried to learn; outside sources, watch more film, and develop."

The change in position took some getting used to. Lima estimated that it took two years to adapt to the more anaerobic running involved. He had to hone his one-on-one defending. Over time he came around to Grimes' view that the position suited him.

"I love the attacking aspect of it," Lima said about playing right-back. "I love to get forward and whip in a ball or get shots off. I think as an outside back, I get to be more myself. I get to be forward, more attacking, and I get to be defensive and aggressive. And I get to work in those transition moments. I think that's where I can outwork the other player and get in their head, push the fitness and make it a physical game. My physical strengths are able to match a lot of players', and I can impose that."

Lima has brought those qualities to the professional ranks. Upon signing with San Jose as a homegrown player in 2017, Lima was thrust into the starting lineup when a heart condition ended the career of incumbent starter Marvell Wynne. He has been excelling for the Quakes ever since, even as the team imploded on its way to a last-place finish in 2018.

A struggling club can oftentimes lead to a player being overlooked in terms of international opportunities. Lima was called into camp a year ago but didn't get off the bench in a friendly against Bosnia & Herzegovina. He was unable to garner another invite for the remainder of 2018. But Lima didn't look at his club team's struggles in terms of what it might do to his national team aspirations, even as other right-backs like FC Dallas' Reggie Cannon and now-Colorado Rapids defender Keegan Rosenberry appeared to get more attention.

"I did my best every game," he said. "There were poor performances and there were good ones. There was only so much I could do. And if I point my finger at something out of my control, that's the worst thing you can do. You play the blame game, that's super unhealthy. I don't think I blamed [the lack of call-ups] on that. I thought, when the time is right, I'll get my opportunity. Luckily enough, Gregg saw something and believed in me. Now I'm just trying to keep the same philosophy."

Lima said that the toughest part of camp has been absorbing all of the information that Berhalter and his staff have thrown at him over the course of the month. The role against Panama certainly had the potential to create information overload, but Lima was able to manage his unique combination of responsibilities.

"I think, first, there was four in the back defensively, so I had an area of comfort in the game," he said. "If things got confusing, I can go back to right-back and I can settle down. This is instinct, and I know what to do. Moving into the attack, it's still reading spaces, working with other guys when I get to go forward, it's just natural. I want to get the ball at my feet, so going forward was something I enjoyed, there was that extra level of enjoyment to be able to do that."

There is a chance that Berhalter will engage in a small bit of player rotation ahead of this weekend's tilt against Costa Rica at Avaya Stadium, Lima's home venue. But even if Lima doesn't start against the Ticos, he has already made the most of his opportunity this month.

"It's the long game, building your way through the ranks," he said. "I'm not the 18-year-old breaking in, so the consistency is the most important thing."

Versatility helps too.