The structure of liquid Al 80 Si 15 P 5 alloy was investigated by ab initio molecular dynamics simulation in order to understand the mechanism of modification of Si primary phases by P in Al–Si alloys. It is found that the chemical environment around P atoms is crucial to provide insight into the structure of liquid Al 80 Si 15 P 5 alloy. The P-centered Al 6 P structural units exist at 1373K but are slightly distorted at 2873K. One P atom usually has other P atoms at the next neighborhood bridged by Al atoms, and also tends to exclude Si atoms from its first coordination shell. Based on the structure information, some aspects related with the modification mechanism are discussed.