On slide three, the loan portfolio grew 445 million during the quarter, represented at 3% quarter-over-quarter and 12% year-over-year growth rate. Second quarter loan growth was driven by continued momentum in the commercial portfolios, as commercial real estate lending grew by 193 million from the first quarter and commercial and business lending increased by 401 million. The commercial real estate business continues to provide us with opportunities for growth and we're seeing solid results from across the footprint including opportunities in the newer loan production offices.
Within commercial and business lending, general commercial loans which includes middle market activity, grew by 139 million, our mortgage warehouse lending unit grew by 122 million, oil and gas loans by 79 million, power and utility loans by 61 million.
The combined retail and residential mortgage portfolio shrank by 149 million during the quarter. Residential mortgage loans were down by a net $50 million due in part to the sale of a 109 million of loans from the portfolio during the quarter. The loan portfolio sale facilitated funding the deposit transfers related to the three branches we sold during the quarter.
The retail loan portfolio which includes home equity loans was down 99 million from the first quarter, home equity balances continue to experience run-off as consumers continue to refinance equity loans in to new mortgages. The mortgage business continued to perform strongly with mortgage loans originated for sales during the quarter of $738 million, which is up 31% from the first quarter. We've been pleased by the continued strength of our mortgage originations and while we expect the current trends to moderate, the third quarter will likely also be an active mortgage banking period.On slide four, average deposits of 15.1 billion were up slightly from the first quarter and have grown by 1 billion or 7% from a year ago. Period end checking and savings account balances are up more than 18% from a year ago. However, period end deposits were down from first quarter levels and flat compared to year-end 2011, partly due to the sale of a (114) million of deposits in connection with the sale to branches in rural western Illinois. Deposit volumes were negatively impacted during the quarter as we continued to allow brokered, collateralized public funds and other high cost time deposits to run off consistent with our disciplined deposit pricing strategy. We continue to be focused on gathering commercial deposits through our enhanced treasury management offerings and while we're beginning to see signs of improving volumes in our annualized checking accounts, we still see significant growth opportunities for expanding these services within our existing footprint and commercial customer base. Read the rest of this transcript for free on seekingalpha.com