WASHINGTON (AP) _ Texas Sen. Phil Gramm dropped out of the Republican presidential race today, declining to endorse front-runner Bob Dole but taking a slap at his chief rival in New Hampshire, Pat Buchanan.

``Our party cannot follow the path of protectionism,'' Gramm told a Capitol Hill news conference announcing his withdrawal in the aftermath of a weak showing in Iowa's GOP caucuses on Monday.

``There always has been a recessive gene in the American character that has found protectionism appealing,'' Gramm said, a poke at Buchanan, who has made his opposition to free trade agreements a keynote of his campaign.

Gramm, once considered Dole's chief rival for the nomination, said he had gotten the message from his poor showing in Iowa and, before that, in Louisiana.

``When the voters speak, I listen,'' he said.

Gramm said he had no plan now to endorse another candidate. Front-runner Dole called him earlier today from New Hampshire but said he had not asked for Gramm's endorsement.

``I enjoyed every day of this campaign,'' Gramm said. ``Some days I enjoyed it better than others.''

When he walked into the room, supporters gave him a noisy welcome. Gramm looked around and asked, ``Where were all you guys in Louisiana and Iowa?''

He had bragged he would win the Louisiana caucuses two weeks ago where Buchanan was his only rival. He finished a poor second. Then came Iowa, and he finished so weak that he was doomed.

``When you run fifth in Iowa, an important state, you would have to be brain dead not to take a look at where you are and what you're doing,'' Gramm told reporters before abruptly cancelling afternoon campaign events Tuesday and leaving New Hampshire.

Gramm, 53, became the third candidate to quit the race. California Gov. Pete Wilson had a short-lived campaign, and Pennsylvania Sen. Arlen Specter quit late last year. Wilson and Specter now support Dole.

Gramm, who had spent at least $19 million in the race, said he was not quitting for lack of money. ``I'm in the black,'' he said.

If he had stayed in the race, observers said, he would have jeopardized his chances of re-election to his Senate seat in Texas.

``It is my goal now to become a great senator,'' he said.

He ended with a laughline: ``I'm tired of coming home late at night and having my own dog bark at me because he doesn't know who I am.''

In advance of Gramm's announcement, Texas GOP Chairman Tom Pauken noted, ``If he's not going to be able to turn it around, then the smart thing to do is simply to pull out and concentrate on the Senate.''

In his phone conversation with Gramm, Dole said he told him, ``Phil, I didn't call to solicit anything...Having been through this I know it's tough,'' he added, referring to his own failed presidential bid in 1988. ``You've invested a couple of years of your life and a lot of time and your wife has. You know, we're friends. We understand each other.''

In his campaign, Gramm sought to capitalize on the spirit of the GOP congressional sweep in 1994. He labeled Dole a compromiser, heralded his own role in pushing Ronald Reagan's tax-cutting 1981 budget through Congress and told audiences, ``I was conservative before conservative was cool.''

He was running in single digits in New Hampshire polls, in a state where religious conservatives do not exercise the same clout as they do in Iowa.

Gramm offered a self-diagnosis of his failing. He said he had tried to be the candidate of social conservatives and economic conservatives alike and ``Maybe in that campaign there is not a market for both.''