With the rapid proliferation of the GPS-equipped devices, a myriad of trajectory data representing the mobility of the various moving objects in two-dimensional space have been generated. In this paper, we aim to detect the anomalous trajectories from the trajectory dataset and propose a novel time-dependent popular routes based algorithm. In our algorithm, spatial and temporal abnormalities are taken into consideration simultaneously to improve the accuracy of the detection. For each group of trajectories with the same source and destination, we firstly design a time-dependent transfer graph and in different time period, we can obtain the top-k most popular routes as reference routes. For a pending inspecting trajectory in this time period, we will label it as an outlier if has a great difference with the selected routes in both spatial and temporal dimension. To quantitatively measure the “difference” between a trajectory and a route, we propose a novel time-dependent distance measure which is based on Edit distance in both spatial and temporal domain. The comparative experimental results with two famous trajectory outlier detection methods TRAOD and IBAT on real dataset demonstrate the good accuracy and efficiency of the proposed algorithm.