Eli Lilly & Co reported higher-than-expected profit on Monday as it controlled costs and revalued overseas inventories because of the stronger dollar, and the drugmaker's shares rose nearly 4 percent.

Earnings increased to $1.31 billion, or $1.20 per share, from $1.06 billion, or 97 cents per share, in the year-earlier period, when results benefited from the resolution of a tax audit.

Analysts on average expected 99 cents per share, according to Reuters Estimates.

The inventory valuations improved the cost of sales, boosting company profit margins by 6.9 percentage points to 83.8 percent.

We don't necessarily expect that level of gross margin improvement throughout the year, company spokesman Mark Taylor said.

Revenue rose 5 percent to $5.05 billion, matching the Reuters Estimates forecast. The company said the stronger dollar crimped sales by six percentage points, yet helped profit margins because of the inventory situation.

The Indianapolis drugmaker said it still expected full-year earnings of $4 to $4.25 per share.

Even though there is no certainty that Lilly's stronger profit margins will hold up, Deutsche Bank Barbara Ryan said the company deserves credit for beating profit forecasts.

Asked whether Monday's stock gains were justified, she said: The drug stocks have all been beaten up; they're cheap.

Sales of Lilly's biggest product, schizophrenia treatment Zyprexa, were flat in the quarter, while sales of depression drug Cymbalta jumped 17 percent to $709 million.

Other strong performers were Lilly's Humalog brand of insulin, whose sales jumped 11 percent to $450 million, and lung cancer treatment Alimta, which soared 36 percent to $335 million. Revenue from anti-impotence pill Cialis rose 6 percent to $359 million.

But sales of Gemzar, a treatment for a variety of cancers, fell 14 percent to $368 million due to generic competition overseas and waning demand in the United States. And osteoporosis treatment Evista fell 2 percent to $257 million.

In trading before the market opened, Lilly shares rose 3.7 percent to $35 from their closing price of $33.75 on Friday.

(Additional reporting by Lewis Krauskopf; Editing by Lisa Von Ahn)