With its restructuring efforts mostly complete, scientific instrument maker Agilent Technologies Inc. said Monday that it turned a profit in its fiscal second quarter.

In the quarter that ended April 30, Agilent said it earned $108 million, or 31 cents per share. A year earlier, the company recorded a loss of $101 million, or 29 cents per share. Agilent reported $22 million in restructuring costs, down from $86 million a year ago.

Revenue rose 17 percent, to $1.27 billion from $1.09 billion.

Excluding one-time items, Agilent said its profit came to 43 cents per share. The profit forecast on average by analysts surveyed by Thomson Reuters, who typically exclude one-time items. Analysts expected revenue of $1.24 billion.

Agilent said its electronic measurement revenue increased 18 percent to $699 million, while life science revenue grew 12 percent to $334 million and chemical analysis revenue rose 19 percent to $238 million.

Agilent completed its $1.5 billion purchase of rival Varian Inc. on Friday. Agilent said it will gain about 8 cents per share in profit and $370 million in revenue from Varian for this year.

It now sees earning $1.70 to $1.75 per share for the year, up from $1.65 to $1.70 per share, and it expects its revenue to grow 12 percent instead of 10 percent. That suggests revenue of about $5.02 billion.

Analysts surveyed by Thomson Reuters on average expect Agilent to earn $1.70 per share on $4.93 billion in revenue for the year.

Agilent forecasts earning 43 cents to 45 cents per share in the third quarter with revenue growth of 16 to 19 percent. That implies revenue of $1.23 billion to $1.26 billion. Analysts are looking for 42 cents per share in profit on $1.2 billion in revenue for the third quarter.

Shares of Agilent fell 70 cents, or 2.1 percent, to $33.49 after hours. They rose about 1 percent in regular trading Monday to close at $34.19.