Knight Capital has been handed a lifeline after it agreed a $400m (£257m) rescue deal with a group of Wall Street firms, enabling it to continue trading.

An IT glitch on Wednesday caused its trading to go haywire, losing it $440m.

Knight Capital is a major market-maker on the New York Stock Exchange (NYSE), creating a market for particular shares enabling investors to buy or sell.

The rescuers include financial firms Blackstone and TD Ameritrade.

The Chicago-based market-maker Getco and financial services companies Stifel Nicolas, Jefferies Group and Stephens Inc are also involved, Knight Capital said in a statement.

"The array of participants in this capital infusion underscores Knight's critical role in the capital markets. With our financial position strengthened and liquidity restored, we will continue to provide clients with trading in a broad range of securities, high-quality execution and outstanding client service," Knight Capital's chief executive Tom Joyce said.

The company has agreed to sell the consortium of investors convertible securities in exchange for the $400 cash injection.

These will be converted into 267m shares of the company, Knight said in its filing to the US Securities and Exchange Commission.

This means that the consortium is expected to end up owning just over 70% of Knight Capital, diluting existing shareholders' stakes.

Its shares were down more than 25% when trading opened in New York, at $3.06. Less than three weeks ago, they were worth more than $12 a share.

Keeping clients

However, despite the rescue deal enabling Knight Capital to resume operations, it will still have to persuade clients to return to it.

TD Ameritrade and Scottrade had already said they would be returning their business to Knight, but others such as Vanguard said they were not yet ready to trade with Knight again.

TD Ameritrade is the biggest volume brokerage in the US, carrying out much of its futures, foreign exchange and bond trading through Knight Capital's systems, which means it would be very inconvenient for it if Knight were to stop trading.

Knight Capital said that a faulty upgrade to its trading software had caused numerous erroneous trades to be sent.

It is thought that the firm racked up its loss, equivalent to half of the value of its equity, in the space of just a few minutes.

"Clearly, we're not happy with how it played out," Mr Joyce told CNBC in an interview after the deal was announced, adding that Knight was now arguably in better financial shape than before the IT problems.

The software glitch is thought to have affected Knight's trading algorithms, which are computer programs that automatically and speedily send out buy and sell orders based on market data and client requests.