Hefty charges for taxes and restructuring pushed BMC Software ( BMC) to a first-quarter loss.

But with the charges excluded, the mainframe software vendor beat Wall Street's expectations Tuesday by 7 cents a share and the company raised guidance for the year.

The news gave the stock a solid, after-hours bounce. In recent trading, shares were up $1.59, or 8.9%, to $20.34.

The Houston company swung to a loss of $41.1 million, or 19 cents a diluted share, compared with a profit of $10.7 million, or 5 cents a share, posted in the first quarter of last year. Sales were up 7% to $348.3 million, the company said after the bell.

Excluding a 14-cents-a-share restructuring charge and a 17-cent-a-share charge related to the repatriation of foreign earnings, BMC earned $43.9 million, or 20 cents a diluted share.

Analysts polled by Thomson First Call were looking for EPS of 13 cents on revenue of $334.9 million.

BMC forecasts second-quarter EPS of 20 cents to 25 cents vs. 20 cents consensus; it sees revenue of $355 million to $370 million for the quarter vs. $359.95 million consensus.

The company also raised its outlook for the full year. For fiscal year 2006, the company expects EPS of 90 cents to 96 cents compared with analysts' estimates of 85 cents on revenue of $1.49 billion to $1.52 billion compared with the $1.49 billion analysts sought.

License bookings for the first quarter of fiscal 2006 were $99.6 million, an increase of 19% over last year.

Last month's announcement of the introduction of new mainframes by IBM ( IBM - Get Report) was good news for BMC, along with competitive software vendors Computer Associates ( CA) and Compuware ( CPWR), said A.G. Edwards analyst Kevin Buttigieg, whose firm does not have an investment banking relationship with BMC.

But because the new products represent a refresh of an existing line, as opposed to fresh offers, the upside will be muted, he said. More gains are likely in the December quarter, after Big Blue's debut of new, high-end mainframes called S54.

The company is expected to give its outlook for the second quarter in a conference call later Tuesday.Shares closed the regular session down 2% to $18.82.