Lima, 23, is a Homegrown defender in his second season with the Earthquakes. He's made 38 appearances in MLS regular season play in that span, including 16 starts this year. The right back has scored three goals and two assists to date in league play.

"From the beginning of my time with the Quakes, it has meant the world to me to be able to play for my hometown club," said Lima in a team statement. "From the minute that I signed my first contract, the support that I have received has been beyond all expectations. I am very excited to extend my stay with the Quakes and will continue to give everything I have for this club because so far, it has given me more than I could ask for."

The Castro Valley, Calif. native finished fourth in MLS Rookie of the Year voting in 2017.

"Nick has the passion and technical skills that differentiate him from his competitors on the pitch," said Earthquakes general manager Jesse Fioranelli. "He is very driven and sets high expectations for himself, which helps us grow us a team. Nick also has a special relationship with our fans because of his ascension through the academy pipeline to the First Team and proudly sets an example for others. Nick brings a unique talent to the Quakes, and we are happy to have him as part of the family for several seasons to come."