Royal Bank of Scotland has blamed a cyber-attack for IT problems that prevented customers accessing their bank accounts for the second time in a week.

Customers feared a computer crash was under way when some were unable to access their online accounts on Thursday night and at lunchtime on Friday.

The bank said its systems had been deliberately targeted: "Due to a surge in internet traffic deliberately directed at the NatWest website, customers experienced difficulties accessing some of our customer websites today.

"This deliberate surge of traffic is commonly known as a distributed denial of service (DDoS) attack. We have taken the appropriate action to restore the affected websites."

A denial of service attack involves overwhelming a company's servers with useless requests, bringing them to a standstill. The distributed version uses thousands of computers under the control of one attacker to do the same thing.

US banks, such as Citigroup and Bank of America, are reported to have been victims of similar attacks, which are aimed at high-profile institutions to cause maximum disruption. Earlier this week JP Morgan, the biggest US bank, said it had been hit by a different type of cyber-attack, warning 465,000 cash card customers that their personal information by have been accessed by hackers.

RBS apologised for the latest problem and insisted it was unrelated to a systems meltdown on Monday that lasted for three hours and resulted in millions of people being denied access to cash and left unable to make payments.

RBS said there was no risk to customers at any point on Friday, after its NatWest online service was targeted from 11.36am. The problem was largely fixed in just over half an hour but had a knock-on effect on other websites operated by the bailed out bank, including RBS, until 12.30pm. Online customers were also affected on Thursday evening.

The bank used Twitter to direct customers to an alternative web address to try to maintain access to services. Customers using apps did not report any problems.

City regulators have been concerned about the security of banks' IT systems and last month conducted a "war game" stimulation of an attack on financial markets. A denial of service attack is said to have been among the scenarios the 100 or so banks and financial services firms played out in the so-called Waking Shark II exercise.

The cyber-attack hit while the 81% taxpayer-owned bank was still handling the fallout from Monday's interruption between 6.30pm and 9.30pm. It has been opening 1,000 branches early to help customers who lost money and handle complaints.

The attack is the latest computer problem to hit the bank in 18 months. A botched software upgrade in June 2012 left RBS with a £175m bill for compensation for up to 13 million customers. Ulster Bank's customers were inconvenienced for more than a month while some NatWest and RBS customers experienced difficulties for about 10 days.

The bank has earmarked £450m for upgrading its IT systems, which were developed when RBS bought NatWest in 2000. Union leaders had blamed cost-cutting for Monday's problems, while Ross McEwan, the bank's new chief executive, blamed decades of under-investment in IT.