Long-term time series prediction is to predict the future values multi-step ahead. It has received more and more attention due to its applications in predicting stock prices, traffic status, power consumption, etc. In this paper, a k-nearest neighbors (k-NN) based least squares support vector machine (LS-SVM) framework is proposed to perform long-term time series prediction. A new distance function, which integrates the Euclidean distance and the dissimilarity of the trend of a time series, is defined for the k-NN approach. By selecting similar instances (i.e., nearest neighbors) in the training dataset for each testing instance based on the k-NN approach, the complexity of training an LS-SVM regressor is reduced significantly. Experiments on two types of datasets were conducted to compare the prediction performance of the proposed framework with the traditional LS-SVM approach and the LL-MIMO (Multi-Input Multi- Output Local Learning) approach at the prediction horizon 20. The experimental results demonstrate that the proposed framework outperforms both traditional LS-SVM approach and LL-MIMO approach in prediction. Furthermore, experimental results also show the promising long-term prediction ability of the proposed framework even when the prediction horizon is large (up to 180).