(Reuters) - U.S. tax preparer H&R Block Inc (>> H & R Block Inc) said it would sell its bank unit to BofI Federal Bank, freeing the company from Federal Reserve oversight.

Shares of H&R Block, which was forced to end an earlier deal to divest the division, rose about 7 percent after the bell.

BofI Federal Bank, which operates from a single location in San Diego, is a unit of BofI Holding Inc (>> BofI Holding, Inc.).

BofI Holding shares were up more than 10 percent in extended trading.

"H&R Block's sale of the bank has the potential to be a seismic event for the stock," BTIG analyst Mark Palmer said in an e-mail.

"By removing itself from Federal Reserve oversight, HRB would be in position to lever itself up and use the proceeds to buy back a very significant portion of its outstanding shares," Palmer said.

H&R Block said it expects the deal to generate excess capital of about $200 million to $250 million.

The company has been seeking strategic alternatives for H&R Block Bank since October 2012 to avoid a sharp rise in costs associated with the introduction of stricter banking rules by the U.S. Federal Reserve.

"This is an important step in ceasing to be regulated as a savings-and-loan holding company," H&R Block Chief Executive Bill Cobb said in a statement.

The company said in July it would sell its banking assets to a unit of Republic Bancorp Inc (>> Republic Bancorp, Inc. KY) but failed to close the deal in October as it could not get regulatory approvals.

H&R Block said on Thursday it expected the transaction to dilute its earnings by about 7-9 cents per share beginning in fiscal 2015. The company also said it expects to incur a related loss of about 3 cents per share in 2014.

The company also expected to incur a related one-time charge of about 1 cent per share in 2014 and about 2-3 cents per share in 2015.

H&R Block expects the deal to close in time for the next tax season.

BofI Federal said in a separate statement it would get about $450 million to $550 million in customer deposits and balances on prepaid cards, including Emerald Cards, as part of the deal.

Goldman Sachs & Co and First Annapolis Consulting Inc were the financial advisers to H&R Block. Stinson Leonard Street LLP and Covington & Burling LLP were the legal advisers.

H&R Block shares closed at $28.42 on the New York Stock Exchange, while BofI Holding closed at $74.44 on the Nasdaq.

(Reporting by Avik Das in Bangalore; Editing by Simon Jennings and Sriraj Kalluvila)

By Avik Das