Juniper Networks Inc., which makes routers and other Internet equipment, said Thursday that its profit fell slightly despite a modest increase in sales, but both results topped expectations.

The results nearly matched those of a year earlier, and put an upbeat ending on a year in which Juniper's profit fell by more than half.

Chief financial officer Robyn Denholm said the company began 2010 "with optimism for an improved environment as the economy strengthens."

The shares jumped more than 5 percent in extended trading after the results were released.

The company earned $131 million, or 24 cents per share, in the fourth quarter, compared with $132.5 million, or 25 cents per share, a year earlier.

Without one-time items including stock-based compensation costs and amortization of intangibles, the company said it would have earned $173.7 million, or 32 cents per share.

Analysts, who usually exclude such items from their forecasts, had expected 26 cents per share, according to Thomson Reuters.

Revenue rose 2 percent to $941.5 million, beating analysts' projection of $884.8 million.

For all of 2009, the Sunnyvale company earned $225.1 million, or 42 cents per share, compared with $511.7 million, or 93 cents per share, in 2008. Revenue fell to $3.32 billion from $3.57 billion.

Juniper's shares fell 53 cents, or 2.1 percent, to $24.49 in regular trading before the report was released. In about 45 minutes of extended trading, they gained $1.45, or 5.9 percent, to $25.96.