The U.S. economy shrank slightly less in the first quarter than initially estimated, while corporate profits rebounded, according to government data on Friday that pointed to moderation in the recession.

Perceptions that the worst of the 17-month-old downturn was over pushed consumer confidence to its highest in eight months in May, and a report showing business activity in New York City expanded in May for the first time since January 2008 offered a further hint the recession was abating.

Gross domestic product, which measures total goods and services output within U.S. borders, contracted at a 5.7 percent annual rate in the first quarter, the U.S. Commerce Department said, less than the initial 6.1 percent estimate. This followed a 6.3 percent fall in the fourth quarter.

While the drop was still steep, recent data, such as housing and new filings for unemployment benefits, have hinted at an easing in the rate at which the economy was tumbling and many economists expect growth to resume by year-end.

Still, output has declined for three straight quarters for the first time since 1974-1975 in a contraction that is the deepest since at least the 1950s. Already, the recession is the longest since the Great Depression, although much less severe.

The recession is easing. The second quarter is shaping up to be a smaller decline of about 3.0 to 3.5 percent. It should be the last of the negative quarters, said Christopher Low, chief economist at FTN Financial in New York.

But the positive outlook for the economy was tainted by a report showing business activity in the country's Midwest unexpectedly fell sharply in April, likely reflecting troubles in the automotive sector.

U.S. stock indexes ended more than 1 percent higher as the rebound in corporate profits and the upbeat consumer confidence report helped to underpin investor morale. A rally in commodity prices lifted shares of natural resource companies.

Longer-dated government bond prices jumped, with investors wading back into the market after a sharp two-month sell-off that drove yields to six-month highs this week.

The report on GDP suggested sharp belt tightening by business was paying off as corporate profits after taxes rose 1.1 percent in the January-March quarter, the first increase in a year. In the fourth quarter, profits had plummeted 10.7 percent, the biggest decline since the start of 1994.

LESSENING INTENSITY

It provides some hints that maybe corporations might have the ammunition to put some money to work in the economy. We are seeing some signs that the intensity of the recession is lessening, said Michael Strauss, chief economist at Commonfund in Wilton, Connecticut.

Economic activity in the first quarter was dragged down by cutbacks in spending by businesses and the government, a further retrenchment in homebuilding and a drop in business investment spending, as well as a slump in exports.

Business inventories fell $91.4 billion after slipping by $25.8 billion in the fourth quarter. Last month, the department estimated the drop in inventories at a record $103.7 billion in the first quarter.

Inventories subtracted 2.34 percentage points from the overall GDP figure. Excluding inventories, GDP would have contracted 3.4 percent.

While the less steep fall in the stock of unsold goods helped to lessen the severity of the economy's contraction in the first quarter, analysts said this suggested inventories would remain a drag on growth in the second quarter.

Exports fell at a 28.7 percent pace, the largest decline since the fourth quarter of 1971, after dropping at a 23.6 percent rate in the fourth quarter.

The drop in exports lopped off a record 3.86 percentage points from GDP, and reflected the slump in global demand. Sluggish domestic demand saw imports plunging 34.1 percent, adding a record 6.05 percentage points to first-quarter GDP.

Business investment spending tumbled a record 36.9 percent and homebuilding activity fell 38.7 percent, the biggest decline since the second quarter of 1980.

Consumer spending, which accounts for over two-thirds of U.S. economic activity, rose 1.5 percent -- slower than the 2.2 percent rate estimated last month -- but still a turnaround after a sharp plunge in the second half of last year.

This was also viewed as another factor that could weigh on the economy in the second quarter.

The lower consumption figure is a reminder of the fundamental problems that households are facing, and the slower inventory run-down means that there is more to come in the current quarter, said Harm Bandholz and economist at Unicredit Markets & Investment Banking in New York.

But spending could pick up in the third quarter as households grow more optimistic about the economy and the government's $787 billion package of spending and tax cuts filters through.

The Reuters/University of Michigan Surveys of Consumers' sentiment gauge rose to 68.7 in May from 65.1 in April. That was the highest reading since September.

Separately, the National Association of Purchasing Management-New York's local business conditions index rose to 361.6 in May from 356.0 the previous month.

(Additional reporting by Richard Leong and Ellen Freilich in New York and Ros Krasny in Chicago; Editing by James Dalgleish)