The British Railways Act of 1921 forced a consolidation of the railways into four systems that lasted until 1947, when the railways were nationalised.
The Barry Railway Company was merged with the Great Western Railway (GWR) the next year.
By this time it had tracks covering 68 miles (109 km) of route, and large amounts of equipment.
In addition to coal wagons the company ran suburban passenger services.
W. Waddell, general manager of the Barry, became assistant to the chief of the GWR docks department.
The acquisition made the GWR the world's largest dock owner.
With ports in Barry, Cardiff, Swansea, Newport, Penarth and Port Talbot the GWR shipped over 50 million long tons (51,000,000 t) each year, three-quarters of which was South Wales coal.

There was a short boom in 1923, after which GWR made heavy investments in adapting the hoists and tips in its docks and sidings to handle the 20-ton wagon, but the collieries were often unwilling to adopt the new size despite offers of rebates.

1923 proved to be the post-war peak.

Coal output in Wales dropped from a total of 57.4 million long tons (58,300,000 t) that year to 37.7 million long tons (38,300,000 t) in 1928, and continued to fall as ships converted from coal to oil.

In May 1926 GWR was involved in the General Strike of mine workers, continuing to run trains during the strike while miners had downed tools.

This caused resentment that lasted for many years.

The mines remained closed until the winter of 1926, causing a severe loss to GWR, which was also starting to feel competition from road transport.

In October 1929 the Wall Street crash heralded the start of the Great Depression.

In 1926 the freight line from Penrhos South Junction to Barry Junction (B&M) was closed.
In 1930 through passenger traffic from Tonteg Junction to Pontypridd Craig and Hafod Junction ceased but freight continued until 1951, when that section was closed, following which,  traffic was diverted to run to Treforest Junction from Tonteg Junction until the entire branch closed in 1963.

By 1935 export volumes of the GWR ports were 55% of the 1923 peak and import volumes were 63% of the 1923 peak.

The next year GWR "temporarily" closed the port of Penarth.

During World War II (1939–45) the Barry Docks were used to import war materiel.

A ring of barrage balloons protected the docks.
One was located on the mole and another beside the Barry Island Station.

The US Army built a large camp in the spring of 1942 to house troops that serviced the docks.

The 517 Port Battalion, with about 1,000 men in four companies, had moved to Hayes Lane Camp in Barry by September 1943.

Three companies worked at the Barry docks, discharging cargo, while the fourth moved to Cardiff.

The Americans imported vast amounts of food through the Cardiff and Barry Docks to feed their troops.

The quantity and quality causing some resentment from the local people, who were making do with wartime rations.

In the first part of 1944 there was intense activity in preparation for the Normandy landings.

The Barry docks were an embarkation point for troops in the second and later waves of this invasion.
Porthkerry Park was used as a vehicle park and ordnance store.

15,000 long tons (15,000 t) of equipment, including 1,269 vehicles, and 4,000 troops were carried from the Docks to Normandy.

After the invasion, coal was carried from Barry to liberated ports in France.

Under the Transport Act 1947 the British Transport Commission was created, taking over all the railways, buses, canals and port facilities in Britain.

The Geest company used the docks to import West Indian bananas from 1959 until the 1980s.

After they ended this operation, the port continued to decline.

The British Transport Docks Board (BTDB) was created under the Transport Act 1962, assuming control of the ports including Barry.

In September 1962 the passenger railway service from Barry to Pontypridd was terminated.
Goods service at stations was cancelled in April 1964.
but the through line was officially closed in July 1963 following the devastating fire at Tynycaeau Junction s
The British Railways Act of 1921 forced a consolidation of the railways into four systems that lasted until 1947, when the railways were nationalised. The Barry Railway Company was merged with the Great Western Railway (GWR) the next year. By this time it had tracks covering 68 miles (109 km) of route, and large amounts of equipment. In addition to coal wagons the company ran suburban passenger services. W. Waddell, general manager of the Barry, became assistant to the chief of the GWR docks department. The acquisition made the GWR the world's largest dock owner. With ports in Barry, Cardiff, Swansea, Newport, Penarth and Port Talbot the GWR shipped over 50 million long tons (51,000,000 t) each year, three-quarters of which was South Wales coal.
There was a short boom in 1923, after which GWR made heavy investments in adapting the hoists and tips in its docks and sidings to handle the 20-ton wagon, but the collieries were often unwilling to adopt the new size despite offers of rebates.
1923 proved to be the post-war peak.
Coal output in Wales dropped from a total of 57.4 million long tons (58,300,000 t) that year to 37.7 million long tons (38,300,000 t) in 1928, and continued to fall as ships converted from coal to oil.
In May 1926 GWR was involved in the General Strike of mine workers, continuing to run trains during the strike while miners had downed tools.
This caused resentment that lasted for many years.
The mines remained closed until the winter of 1926, causing a severe loss to GWR, which was also starting to feel competition from road transport.
In October 1929 the Wall Street crash heralded the start of the Great Depression.
In 1926 the freight line from Penrhos South Junction to Barry Junction (B&M) was closed. In 1930 through passenger traffic from Tonteg Junction to Pontypridd Craig and Hafod Junction ceased but freight continued until 1951, when that section was closed, following which,  traffic was diverted to run to Treforest Junction from Tonteg Junction until the entire branch closed in 1963.
By 1935 export volumes of the GWR ports were 55% of the 1923 peak and import volumes were 63% of the 1923 peak.
The next year GWR "temporarily" closed the port of Penarth.
During World War II (1939–45) the Barry Docks were used to import war materiel.
A ring of barrage balloons protected the docks. One was located on the mole and another beside the Barry Island Station.
The US Army built a large camp in the spring of 1942 to house troops that serviced the docks.
The 517 Port Battalion, with about 1,000 men in four companies, had moved to Hayes Lane Camp in Barry by September 1943.
Three companies worked at the Barry docks, discharging cargo, while the fourth moved to Cardiff.
The Americans imported vast amounts of food through the Cardiff and Barry Docks to feed their troops.
The quantity and quality causing some resentment from the local people, who were making do with wartime rations.
In the first part of 1944 there was intense activity in preparation for the Normandy landings.
The Barry docks were an embarkation point for troops in the second and later waves of this invasion.Porthkerry Park was used as a vehicle park and ordnance store.
15,000 long tons (15,000 t) of equipment, including 1,269 vehicles, and 4,000 troops were carried from the Docks to Normandy.
After the invasion, coal was carried from Barry to liberated ports in France.
Under the Transport Act 1947 the British Transport Commission was created, taking over all the railways, buses, canals and port facilities in Britain.
The Geest company used the docks to import West Indian bananas from 1959 until the 1980s.
After they ended this operation, the port continued to decline.
The British Transport Docks Board (BTDB) was created under the Transport Act 1962, assuming control of the ports including Barry.
In September 1962 the passenger railway service from Barry to Pontypridd was terminated. Goods service at stations was cancelled in April 1964. but the through line was officially closed in July 1963 following the devastating fire at Tynycaeau Junction s
Barry Docks