One of the most important safety design issues for a hydrogen production system coupling with a high-temperature gas-cooled reactor (HTGR) is to ensure reactor safety against fire and explosion accidents because a large amount of combustible fluid is dealt with in the system. The Japan Atomic Energy Research Institute has a demonstration test plan of a hydrogen production system by steam reforming of methane coupling with the high-temperature engineering test reactor (HTTR). In the plan, we developed the P2A code system to analyze event sequences and consequences in detail on the fire and explosion accidents assumed in the HTGR or HTTR hydrogen production system. This paper describes the three accident scenarios assumed in the system, the structure of P2A, the analysis procedure with P2A, and the results of the numerical analyses based on the accident scenarios. It is shown that P2A is a useful tool for the accident analysis in the system.