In the 1920s, WAGR found that it did not have a sufficient number of suitable locomotives for long-distance express trains and that the 1902 E-class Pacifics were no longer up to date. The main aim was to eliminate the need for helper engines on the Darling Scarp's inclines and to reduce the number of stopovers to replenish supplies with the help of a more economical engine. It was hoped that the journey time on the Trans-Australian Railway's own section would be significantly reduced. In order to use the low-energy coal from the Collie fields, the new locomotive also had to have a large grate, which was easy to implement with the design as a Pacific.
Ernest A. Evans developed a Pacific, which was influenced by the New Zealand Railways Class AB and the Tasmanian Government Railways Class R, and had a Belpaire firebox. The first ten examples were made by North British in Scotland in 1924 and 1925. In 1927 and 1929, a total of 15 more from the WAGR's own Midland Railway workshops followed. They initially received new tenders, but some were later converted to shorter tenders from the old R class.
Since towards the end of the thirties there were still many old locomotives in stock that had to be replaced with more modern ones, ten more class P locomotives were ordered. They received various improvements in details in the areas of boiler, bogie, headlights and valve gear. As the first WAGR locomotives ever, they were given names, which in this case came from Western Australian rivers. Thus they were initially only known as the River class, but in 1946 they were given the new designation Pr.
With the boiler pressure increased from 160 to 175 psi, these enignes were able to move trains trains of 555 long tons at gradients of 1 in 80. The axle load could be switched between the original 12.8 long tons of the class P to 14.2 long tons. Initially, the new locos were used uniformly with the old locos, with the boiler pressure set at 160 psi while not making use of the higher axle load. Only later were the safety valves adjusted differently and the device to change over the axle load used. At the same time, eight pieces of the original design were brought up to the same level.
During the Second World War, the P and Pr classes were often used for troop transport. After the war they were temporarily converted to oil firing when there were problems obtaining coal from the Collie fields. They were supposed to be replaced by the Pm and Pmr classes, but this did not work due to their poor running characteristics and the P and Pr classes remained in express train service. The boilers were later brought up to the same standard as the Pm and Pmr. After the introduction of the X-class diesel locomotives in 1954, the steam locomotives were relocated to freight and shunting service. They were finally retired between 1967 and 1969 and today one P and one Pr each survive.