Maryland's carrot-and-stick tax amnesty ended last night after paying handsome dividends to the state. Delinquent people and corporations came forward and paid more than $25 million, easily exceeding the goal for the two-month program.

The 10,000 delinquent taxpayers ranged from a multinational corporation that wrote a check for $2.7 million, to a 21-year-old custom cabinet maker from Temple Hills, who paid $700 he said he owed for 1985. The smallest payment was 20 cents for unpaid sales tax.

People accounted for 80 percent to 85 percent of the checks and returns submitted, but corporations provided 70 percent of the funds received, according to Assistant State Comptroller Marvin Bond.

Maryland was the latest of several states and the District of Columbia -- starting with Massachusetts in 1982 -- to go after back taxes with the promise that civil and criminal penalties would be waived, and the threat that they would be stiffened after the deadline.

Starting today, delinquent Maryland taxpayers will be subject to stiffer criminal penalties, up to five years in prison and a $5,000 fine for each count, compared with the one year and $1,000 previously in effect. Furthermore, civil penalties will increase from 10 percent to 25 percent of taxes owed.

Comptroller Louis L. Goldstein said his office would begin withholding checks from firms doing business with the state, if they are delinquent in their taxes. A sophisticated new computer and 36 more auditors will also be employed to beef up the state's enforcement.

To encourage corporate compliance, the state in recent years has used retired Internal Revenue Service auditors based in New York, Chicago and Los Angeles to review company returns and to develop and follow up investigative leads. State officials would not identify delinquent taxpayers.

Amnesty payments were no windfall of surplus funds for the state. The governor had already committed the $20 million in his 1987 budget. By last night, the Maryland program had brought in $25.1 million. Of the total, $9 million came from out-of-state taxpayers, including $1 million from the District.

Within the state, Montgomery County was producing the largest amount of revenue, more than $2 million. A Montgomery County taxpayer's check for $10,000, representing five years of delinquent income taxes, pushed the state total over $20 million, according to Bond.

"We're very well satisfied," said Bond, who, with Goldstein, toured the state to promote the program. "The end of September, we hadn't heard from Garrett County," the westernmost in the state. "Three days after we got back from there, checks started coming in."

The state spent $375,000 to advertise the program. But at least one advertisement, noting that 1920s mobster Al Capone had gone to jail for tax evasion, was canceled after some Italian Americans in Baltimore criticized it as an ethnic slur.

Another widely circulated advertisement showed a picture of cocky but ill-fated Indian fighter Gen. George Custer with the legend: "Custer was sure to beat the Indians. Are you sure you can beat Maryland out of back taxes?"

According to Bond, the state sought to learn from the failures and successes of amnesty programs elsewhere. The most successful -- among them Illinois, Massachusetts, California -- advertised and stiffened penalties. But some states, such as New York, allowed for installment payments, slowing the incoming cash flow.

Massachusetts brought in more than $40 million in its pioneering effort. New York and New York City combined brought in 10 times as much. The District's three-month amnesty program, which ended Sept. 30, was said by city officials to have brought in around $10 million.

At the New Carrollton state tax office yesterday, six persons were sitting in the hallway when office manager Virginia Shaw opened for business at 8:30 a.m. By 1:30 p.m., 99 persons had visited the office and 15 of them were waiting in the small reception room to meet with state auditors.

Almost all of them declined to give their names, but several offered anonymous explanations. One man, 39, said he owed $3,000 in taxes for the years he lived in Maryland and worked in Virginia.

"It's always been in the back on my mind," he said. "I've never done a dishonest thing in my life. I have a 22-month-old I have to tell to do the right thing all his life, so it was a matter of conscience."