An accurate algorithm for locating faults on two-terminal transmission lines is presented in this study. The presented method does not require values of line parameters to locate the fault; therefore variation of line parameter values does not affect its accuracy. The method utilises synchronous post-fault measurements of currents and voltages in both terminals and is based on the distributed time-domain representation of transmission lines. Unlike conventional methods, fault location is converted to an optimisation problem. Then, this problem is solved by genetic algorithm to find the accurate location of fault. Furthermore, modifying the problem to be solved by the Newton optimisation method is discussed in this study. Simulation results performed by ATP/EMTP verify high accuracy of the presented method, and reveal that it is not significantly affected by fault resistance, fault type, fault inception angle and source impedance. Moreover, effect of measurement errors and synchronisation errors on the accuracy of presented method have been analysed which verify the efficiency of the algorithm in these conditions.