HCS, which makes mechanical, hydraulic and electrical equipment for subsea projects, said it will use the money to take advantage of growth in the industry now the dust has settled from the buyout.
"We have worked pretty hard within the business to get everything in place so we were in a position to look for a new and better banking deal," said chief executive Brett Lestrange.
"We were quite frankly working day to day trying to pay bills while trying to fund growth. This package takes the pressure off and allows us to focus on more important things."
Mr Lestrange became chief executive of HCS when the company brought in new investors in June 2013.
Private equity groups Maven Capital Partners and Simmons Parallel Energy Fund led an investment of £9m in HCS as part of a buyout by new and existing management.
The firm has extended its site in Glenrothes and increased its headcount from 55 to 80 since the deal. Mr Lestrange said he expects to reach a total of 100 employees, primarily in Fife, within the next year.
The new funding package will also allow HCS to buy containers in order to offer servicing for its customers as well as equipment for oil and gas projects worldwide.
"Life is pretty tough in the SME world and the classic saying is that the banks are never there when you need them, but RBS has been there and we were really pleased with the response we got," said Mr Lestrange.
The funding agreement with RBS marks the 10th deal in as many months for the bank's Aberdeen-based structured finance deal.
Lee Donaldson, director of structured finance at RBS, said: "We have a long and successful track record of supporting private equity-backed oil and gas service companies. This deal with HCS is a further example of our strong commitment to growth businesses operating within this sector."
According to the trade body Subsea UK, two-thirds of all new oil and gas fields in the country are being developed using subsea techniques through systems on the sea bed. The industry employs 53,000 people.