Democratic presidential candidate Martin O’Malley (Paul J. Richards/AFP/Getty Images)

Democratic presidential hopeful Martin O’Malley stepped up his efforts to court Latino voters this week, appearing before a Hispanic business group and on Spanish-language television.

The former Maryland governor pledged to tackle comprehensive immigration reform during his first 100 days if he makes it to the White House, and he touted his record in Annapolis, which includes signing legislation that allows undocumented immigrants to get driver’s licenses and in-state college tuition rates.

While those and other measures have drawn applause from national immigrant rights advocates — with some declaring O’Malley’s record the strongest in the Democratic field — Maryland lawmakers present a more nuanced view.

Latino legislators and other advocates credit O’Malley with providing help at key junctures but add that on some issues, he wasn’t doing the heavy lifting. And at some points, particularly during the long, thorny debate over driver’s licenses, O’Malley was at odds with the advocates.

As he has positioned himself to run in a Democratic field dominated by Hillary Rodham Clinton, O’Malley has made frequent mention of his record on immigration. He often recounts a battle last summer with the White House, when he denounced the administration’s efforts to return migrant children to their home countries after they illegally crossed the border from Central America. And O’Malley has emphasized his decision to limit Maryland’s cooperation with federal officials on deportations from a state-run jail.

Del. Ana Sol Gutierrez (D-Montgomery), a native of El Salvador and the first Latina elected to state office in Maryland, was not always pleased with O’Malley on immigration issues. But on balance, she said, “he really has shown leadership.”

Others are less charitable, among them former delegate Luiz R.S. Simmons, another Democrat from Montgomery. O’Malley, Simmons said, “has a tendency to jump on the caboose of the train as it’s pulling out of the station and put on a conductor’s hat and walk to the front.”

Haley Morris, an O’Malley spokeswoman, said the candidate has “one of the most progressive track records in the country on issues facing new Americans,” noting that Maryland housed more refugee children per capita than other states during the border crisis.

As a 2006 gubernatorial candidate, O’Malley did not focus heavily on immigration. But he supported making driver’s licenses available to undocumented immigrants, a position for which his GOP opponent attacked him in television ads, and for granting in-state tuition rates to college students.

A version of the latter legislation, known as the Dream Act, had been vetoed by O’Malley’s Republican predecessor in 2003.

O’Malley signaled support for the legislation when it was proposed again in 2007, his first year in office. But the bill stalled in the Democratic-led legislature amid concerns over whether it would reduce slots available for students with legal status.

Although O’Malley made clear that he would sign the bill, he did not make it part of his legislative package, a level of priority that he later gave to bills legalizing same-sex marriage and repealing the death penalty.

Advocates tried again in 2011, bringing waves of “Dreamers” to Annapolis to testify and lobby lawmakers. State Sen. Jamie B. Raskin (D-Montgomery) said it was widely known that O’Malley wanted the bill to succeed, which helped secure votes. The measure passed, and Maryland joined nearly a dozen states with similar measures.

Conservative activists petitioned to have the law put to a voter referendum. During the campaign that ensued, O’Malley provided fundraising and other political support. Voters approved the measure by a wide margin, 59 percent to 41 percent. O’Malley “spoke out on the bill and threw down for the campaign,” said Kim Propeack, director of CASA in Action, the political arm of the immigrant advocacy group.

The path to Maryland’s current policy on driver’s licenses had far more twists. When O’Malley took office, Maryland was among just five states where someone could get a license without having to prove they were in this country legally. Critics charged that the program was open to fraud and that it drew illegal immigrants to Maryland. Moreover, the federal government was clamping down on driver’s licenses after the 2001 terrorist attacks.

In 2005, Congress passed the REAL ID Act, which sought to curb state-issued driver’s licenses for those in the country illegally. States were given several years to implement the law, and the exact rules and how they would be enforced changed on multiple occasions, O’Malley aides said.

O’Malley, concerned about threats by the federal government not to allow anyone with a Maryland driver’s license to board an airplane, announced in 2009 that he would support a halt in issuing full-fledged licenses to undocumented immigrants. Lawmakers passed a bill that discontinued new licenses but allowed those who already had licenses to keep a restricted version of them through 2015. The licenses could not be used as identification to enter federal buildings or board airplanes.

Gutierrez and others argued that Maryland should leave its earlier policy in place, in effect daring the federal government — with Democrat Barack Obama in the White House — to enforce the law.

But other Democrats, including O’Malley, were loath to take the risk. “The collective wisdom at the time was we shouldn’t roll the dice on it,” said Brian E. Frosh, then a state senator chairing the Judicial Proceedings Committee and now Maryland’s attorney general.

Four years later, advocates made a renewed push to overhaul the law, and lawmakers approved a bill to issue licenses — with restrictions — to new applicants and renew existing ones beyond 2015. O’Malley signed the bill.

The political climate had changed considerably by then, several lawmakers said, making them more comfortable with the new approach. It seemed clear that the Obama administration wasn’t going to impose punitive measures, and passage of the Dream Act in Maryland in 2011 showed public support for helping immigrants.

Del. Joseline Peña-Melnyk (D-Prince George’s) said it took some persuasion to get O’Malley to support the 2013 bill.

“We showed him the numbers, arguing that immigrants are driving to work and taking kids to school and that it was better for them to have insurance and drive legally than to drive without one,” she said.

Gutierrez credited O’Malley with being “helpful the second time around.”

Since then, O’Malley has spoken out more forcefully on immigration, and he has held up his record as evidence of his commitment to issues of importance to the fastest-growing demographic group in the country.

“One of the greatest indicators of a person’s future actions will be how they acted in the past when they had the power,” O’Malley told the U.S. Hispanic Chamber of Commerce on Wednesday.