Sacramento -- Mexican President Enrique Peña Nieto told California's legislators Tuesday that the state's attitude toward immigration is a model for the rest of the country that "benefits and enriches society."

Hours after an outdoor luncheon where he praised Gov. Jerry Brown for promoting a "new vision" for neighbors linked by history and by millions of citizens with shared roots, Peña Nieto delivered a Capitol address that compared California favorably to the rest of the U.S. on immigration issues.

The Mexican president called for comprehensive immigration reform and stressed the impact that 12 million state residents of Mexican descent have on the state's economy and culture.

Peña Nieto made a nod to those ties when he began his address in English, telling the lawmakers who gave him a warm reception that "I believe most of you speak Spanish."

He then switched to Spanish for his address, saying Mexico "celebrates the bills you have passed" that "contribute to the prosperity" of immigrants in the state without documentation by granting them access to education, labor protection "or the possession of having a driver's license."

"You have sent a very clear message to the United States - and the entire world - that cultural diversity benefits and enriches societies," Peña Nieto said. "That's the right political and ethical stance."

The president said the Mexican government "trusts that very soon ... in this entire country," other states will follow California's lead and that Congress will pass comprehensive immigration reform.

"It is simply a matter of justice," he said.

While some states have passed laws recently cracking down on immigrants' access to public resources such as education, California has been moving in the opposite direction. Brown signed a bill last year granting driver's licenses to immigrants in the country without documentation, and California has moved to accommodate a flood of unaccompanied immigrants who have made their way through Mexico from Central America since last fall.

In the earlier luncheon outside the historic Leland Stanford Mansion near the Capitol, Peña Nieto said, "The government of Mexico has so much respect for what the governor of California has done."

As they dined on a showcase of California-produced products - including hand-pulled mozzarella, heirloom tomatoes and olive oil, chicken breast, peach flan and nut brittle - they could hear the sounds of protests and chants of "Free our Marine!" a block away.

Republican Assemblyman Tim Donnelly, the former gubernatorial candidate, led a lively crowd of about 200 Tea Party and conservative protesters demanding the release of jailed Marine Sgt. Andrew Tahmooressi, who was arrested in Mexico on March 3 after allegedly crossing the border with three loaded guns - a violation of Mexican law.

The case has become a cause celebre among conservatives. Donnelly boycotted the legislative luncheon because he said that Peña Nieto, Brown and President Obama have not tried to help Tahmooressi, who the assemblyman said suffers from post-traumatic stress disorder.

"I refuse to break bread with Andrew's captors," Donnelly said, to the cheers of a crowd that carried signs reading, "Will trade Jerry Brown and Obama for our Marine."

Tahmooressi's name did not come up inside the luncheon tent.

Peña Nieto's two-day visit to the state comes one month after Brown traveled to Mexico City to sign nonbinding agreements aimed at strengthening trade relationships and business deals with Mexico, which imported $29.9 billion worth of goods and services from California last year alone.

The two leaders said they would streamline operations at the California-Mexico border crossings in San Diego County - among the world's busiest, and the focal point of billions of dollars in international business annually. They also pledged cooperation on educational programs, including an unprecedented exchange that would bring 100,000 Mexican students to study at California universities.

Mexico's consul general in San Francisco, Andrés Roemer, said he has invited Mayor Ed Lee for a stay at his home in Mexico City starting Sept. 8. One goal, he said, is to promote informal talks on issues like trade, especially in the innovation and technology arena.

"We want to become friends and strengthen this relationship," Roemer said.