New Canaan-based Bankwell Financial Group Inc. had record earnings in the second quarter, though the bank noted that some nonrecurring items helped push net income higher.

Bankwell had second quarter net income of $12 million, or $1.55 per share, compared to $6.2 million, or $0.79 per share, in the second quarter of 2021. Bankwell also had record net income in the first quarter of 2022, reporting $8.2 million, or diluted earnings per share of $1.04.

The bank said in its second quarter earnings statement that adjusting for nonrecurring items, the bank had second quarter operating earnings per share of $1.15.

Helping to drive earnings was an elevated level of loan prepayments in the second quarter, but Bankwell noted that this activity did not reflect its loan run-rate. The nonrecurring items also included a decrease in the provision for loan losses after the bank released some reserves related to impaired loans that showed improved performance or that had been paid off.

The second quarter net interest margin was 4.01 percent compared to 3.12 percent in the same quarter last year. For the first six months of 2022, the net interest margin was 3.65 percent, up from 2.93 percent during the same period in 2021. In addition to elevated loan prepayment fees, the bank attributed the higher net interest margin to a decrease in rates on interest bearing deposits and an increase in overall loan yields.

Bankwell had total loans of $2.1 billion, up $161.7 million, or 8.5 percent, from Dec. 31.

“Several years ago we put forth a strategic plan to diversify and transform our business model,” Bankwell President and CEO Christopher R. Gruseke said in the statement. “With careful planning and execution, we are now reaping the benefits of investing in that plan.”

Gruseke said the bank’s loan pipeline for the third quarter remained at record levels despite “the backdrop of macroeconomic uncertainty.”

“It is likely that the economy will experience further volatility in the coming quarters,” Gruseke said. “Nevertheless, we are confident that the business we have built will enable us to continue to deliver above-peer group performance.”

Bankwell had total deposits of $2 billion, down 4.3 percent from the end of 2021. The bank attributed the decline to seasonal fluctuations in several municipal and commercial deposit relationships.

The bank’s total assets were $2.44 billion as of June 30 compared to $2.46 billion on Dec. 31.

Bankwell, which has 10 branches in Fairfield and New Haven counties, said it plans to close its Wilton branch in October.