The Ministry of Railways (Urdu: وزارت ريلوے , Wazarat-e-Railway, abbreviated as MoR) is a ministry of the Government of Pakistan tasked with planning, administrating and overseeing government policies for the development of the national rail network, Pakistan Railways. Originally a department of the Ministry of Communications, in May 1974 it formed into an autonomous ministry of the federal government. The ministry headquarters is located at Block D of the Pak Secretariat in Islamabad.
In 1858, several railway companies began laying track and operating in what is today Pakistan. The present Pakistan Railways network was originally built as a patchwork of local rail links operated by small private railway companies. These included the Scinde Railway, Punjab Railway, Delhi Railway and Indus Steam Flotilla companies. In 1870, these 4 companies were amalgamated into the Scinde, Punjab & Delhi Railway company. Shortly thereafter, several other railways lines were built including the Indus Valley State Railway, Punjab Northern State Railway, Sind–Sagar Railway, Sind–Pishin State Railway, Trans–Baluchistan Railway and Kandahar State Railway. These 6 companies along with the Scinde, Punjab & Delhi Railway company merged to form the North Western State Railway in 1880 and would continue as a company until 1947.
In 1947, when Pakistan achieved its independence from Britain, the North Western State Railway and Assam Bengal Railway were inherited by Pakistan and renamed to Pakistan Western Railway and Pakistan Eastern Railway respectively. Both railways were owned by the Government of Pakistan and efforts were made to unify the governance of these two railways under a single railway board. However, until the formulation of the Railway Board, both the railways were administered through the Railway Division of the Ministry of Communications. The division was headed by the Director General of Railways (DG Railways) within the ministry, who had the general supervision over operations.
In 1959, an ordinance bill was passed in the parliament underlying the need for the creation of a semi-autonomous Railway Board. The board was perceived in accordance with the principal powers of the Central Government as stipulated in the Railways Act IX of 1890. Even after the establishment of the Railway Board (RB), the Central Government continued to administer the affairs of the railways, albeit less directly. There were no suggestions of actual transfer of property or changes in the financial relationship of the railways to the government. The board however had the general supervision over the railway operations but referred to the government for matters of general policy. Since its establishment in 1959 and up until 1 July 1962, the Railway Board management consisted of the former DG Railways, a financial member and an engineering member. The board was assisted by a small staff of experts in fields ranging from operations and finances to engineering. General managers were appointed for both railways who were tasked with the day-to-day operations of the railways including procurement, personnel and fares. Under the GMs, the organisation of Pakistan Western Railways was based on a divisional system, while that of Pakistan Eastern Railways was based on a departmental system. However, it later transpired that the departmental system held an inherent weakness as traffic and operational movements increased on the Eastern Railway and decision-making was kept centralized for the railway, needing immediate reforms. Even amidst such teething perils, the management was found competent.
Earlier on 20 September 1924, a special resolution had been adopted by the Legislative Assembly of British India which came to be known as the Separation Convention of 1924. The resolution asked for the separation of railway finances from the general finances of the country. But soon after the independence, the Central Government discarded the resolution and the railway finances were merged with the general finances of the country. In preparation for the second five-year plan (1960—65), the necessity to separate the railway finances from the general revenues continued to be felt.
After the first session of the third national assembly, president Ayub Khan issued a presidential order (PO 33) on 9 June 1962. The presidential order instructed for the transfer of control of both railways, PWR and PER, from the Central Government to the provincial governments of West Pakistan and East Pakistan respectively.  When the presidential order came into effect on 1 July 1962, concurrent Railway Boards were established by both provinces, repealing the original Railway Board Ordinance of 1959. The presidential order also reinstated the formerly discarded Separation Convention, whereby the railway finances were ultimately separated from the general finances for the fiscal year 1961-62 and thereafter, giving each board increased autonomy.
In transferring the jurisdiction of the railways to their respective provincial governments, the resulting provincial Railway Boards exercised all the powers and functions of the former Railway Board (as established in 1959) with the exception of a few responsibilities. To address these exceptional responsibilities, the Central Government established a Central Railway Division which retained certain powers and functions not completely dissolved to the provincial boards. These included the responsibilities of:
- Dealing with international organisations and foreign countries;
- Implementing agreements with such organisations and countries;
- Coordinating rail movements to and from ports; and,
- Coordinating Development Programmes of each railway as part of the National Development Programmes.
Furthermore, the provincial governments were refrained from altering the priority of movement of defence traffic, close or dismantle any railway line, or modify any Ministry of Defence lines, without the prior approval of the Central Railway Division.
With the succession of East Pakistan, the Eastern Railway was inherited by Bangladesh, while the Pakistan Western Railway was taken under control of the President who created the Ministry of Railways in 1974 to look after the planning and policy-making, technical advisory service and management of the railway. The PWR railway was then renamed Pakistan Railways in May 1974. In 1982, the Ministry of Railways was merged with the Railway Board under a presidential order, resulting in the federal ministry as it stands to date. The ministry has since been tasked with administering the various railway junctions and stations in rural, insular and urban areas of Pakistan. Declining passenger numbers and financial losses in the late 1980s to early 1990s prompted the closure of many branch lines and small stations. The 1990s saw severe cuts in rail subsidies and mismanagement within the company. Due to falling passenger numbers, rail subsidies from the government are necessary to keep the railways financially viable.
The Railway Board (RB) is the highest governing body for technical matters for Pakistan Railways and the MoR. The highest form of bureaucrats in the railways consisted the government appoint bureaucrat who is the Chairman of Pakistan Railways- The following list includes the officers and government appoint bureaucrats reporting directly to the Secretary Railways:-i). Secretary Railway Board, MoR, Islamabad.ii) Member Finance, Railway Board, MoR, Islamabad.iii) Director General (Operations) MoR, Islamabad.iv) Director General (Technical) MoR, Islamabad.v) Director General (Planning) MoR, Islamabad.
- Chief Executive/Sr. General Manager of Railway, PR.Headquarters, Lahore.(CEO/Sr.GM)
- Managing Director, PRACS.Rawalpindi.
- Chief Executive (CEO), PRFTC, Rawalpindi.
- Managing Director, REDAMCO, Rawalpindi.
- Managing Director, Railcop, Lahore
- Federal Government Inspector of Railways (FGIR)
- Director-General of Vigilance Department (DG Vigilance)
- All matters pertaining to Pakistan Railways.
- Movement and priority in respect of Defence traffic.
- Maintenance of Railway lines for strategic reasons.
- Negotiations with International Organizations and other Countries and implementation of agreements, with them.
- Coordination of Development Projects of Railways as a part of the National Development Programme.
- Standardization and specifications of materials and stores.
- Overall efficiency and safety of Railways.
- Coordination of Rail movements into and from Ports.
Pakistan Locomotive Factory Risalpur
The Pakistan Locomotive Factory was established in Risalpur at a total cost of ₨228.4 million (US$2.2 million). Its function is to manufacture indigenous diesel electric and electric locomotives, thus allowing Pakistan Railways to have less dependency on foreign technology. The factory has capacity to manufacture 25 locomotives per year.  Technology for manufacturing of locomotives has been acquired from Hitachi Japan, General Electric, ADtranz Germany and Dalian Locomotives & Rolling Stock Works, China.  
Carriage Factory Islamabad
Pakistan Railways Carriage Factory, Islamabad was set up in 1970 under the technical collaboration of LHB, Germany for manufacture of passenger carriages. The capacity of the Factory is 150 passenger coaches per year on single shift basis. 
Railway Estate Development & Marketing Company (REDAMCO)
REDAMCO was established in 2012.  REDAMCO deals with non core business of Pakistan Railways that includes, Development of lands, business of advertisements and hoardings, and matters relating to franchises. 
Pakistan Railway Advisory & Consultancy Services (PRACS)
Pakistan Railway Advisory & Consultancy Services Limited (PRACS) was incorporated in 1976 as a private limited company. In the year 2002, it was converted to a public limited.  PRACS provides a wide range of services in the fields of Civil Engineering, commercial management of passenger trains as well as passenger reservation and ticketing, Rail Cuisine, Mechanical engineering and Electrical engineering. 
Railway Constructions Pakistan Limited (RAILCOP)
Railway Constructions Pakistan Limited (RAILCOP) is a subsidiary of Ministry of Railways was incorporated as a Public Limited Company in 1980.RAILCOP offers services in Engineering fields like railway tracks, railway stations, bridges, overhead bridges, under-passes, tunnels, culverts, railway facilities at port and harbors.RAILCOP has also completed a number of projects in Saudi Arabia, Sudan, Somalia, Iran and Senegal Railways.  
Updated as of August 2018. 
|01||Faisal Hayat||29 October 1958||8 June 1962|
|02||Khurshid Hasan Meer||23 August 1974||22 October 1974|
|03||Mian Muhammad Attaullah||23 October 1974||5 February 1976|
|04||Hafizullah Cheema||5 February 1976||8 March 1977|
|05||Gulam Hussain||30 March 1977||5 July 1977|
|06||N. A. Qureshi||14 January 1978||6 July 1978|
|07||Muhammad Khan Junejo||5 July 1978||23 April 1979|
|08||Maj. Gen Jamal Said Khan||21 April 1979||31 March 1979|
|09||Maj. Gen Saeed Qadir||16 March 1981||5 March 1983|
|10||Nawabzada Abdul Ghafoor Khan Hoti||5 August 1983||26 February 1985|
|11||Yousaf Raza Gillani||28 January 1986||20 December 1986|
|12||Sardarzada Muhammad Ali Shah||15 May 1988||29 May 1988|
|13||Mir Zafarullah Khan Jamali||9 June 1988||24 June 1988|
|14||Zafar Ali Laghari||23 March 1989||5 August 1990|
|15||Mir Hazar Khan Bijarani||9 November 1990||10 September 1991|
|16||Ghulam Ahmad Bilour||10 September 1991||18 July 1993|
|17||Ahmad Faruque||23 July 1993||19 October 1993|
|18||Sardar Muhammad Yaqub Khan Nasar||11 July 1997||6 August 1998|
|19||Chaudhry Shujaat Hussain||7 August 1998||9 November 1999|
|20||Lt. Gen. (R) Javed Ashraf||15 August 2000||23 November 2002|
|21||Ghouse Bux Khan Mehar||23 November 2002||25 August 2004|
|22||Shamim Haider||1 September 2004||24 April 2006|
|23||Shaikh Rasheed Ahmad||25 April 2006||15 November 2007|
|24||Mansoor Tariq||3 December 2007||25 March 2008|
|25||Sardar Mehtab Abbasi||31 March 2008||13 May 2008|
|26||Ghulam Ahmad Bilour||4 November 2008||18 March 2013|
|27||Dr. Abdul Malik Kasi||3 April 2013||5 June 2013|
|28||Khawaja Saad Rafique||7 June 2013||27 July 2017||4 August 2017||31 May 2018|
|-||Roshan Khursheed Bharucha (Acting)||5 June 2018||18 August 2018|
|29||Sheikh Rasheed Ahmad||18 August 2018|