  Let $\mathbb{F}_q$ be a finite field of size $q$ and $\mathbb{F}_q^*$ the set
of non-zero elements of $\mathbb{F}_q$. In this paper, we study a class of
twisted generalized Reed-Solomon code $C_\ell(D, k, \eta, \vec{v})\subset
\mathbb{F}_q^n$ generated by the following matrix \[ \left(\begin{array}{cccc}
v_{1} & v_{2} & \cdots & v_{n} \\ v_{1} \alpha_{1} & v_{2} \alpha_{2} & \cdots
& v_{n} \alpha_{n} \\ \vdots & \vdots & \ddots & \vdots \\ v_{1}
\alpha_{1}^{\ell-1} & v_{2} \alpha_{2}^{\ell-1} & \cdots & v_{n}
\alpha_{n}^{\ell-1} \\ v_{1} \alpha_{1}^{\ell+1} & v_{2} \alpha_{2}^{\ell+1} &
\cdots & v_{n} \alpha_{n}^{\ell+1} \\ \vdots & \vdots & \ddots & \vdots \\
v_{1} \alpha_{1}^{k-1} & v_{2} \alpha_{2}^{k-1} & \cdots & v_{n}
\alpha_{n}^{k-1} \\ v_{1}\left(\alpha_{1}^{\ell}+\eta\alpha_{1}^{q-{2}}\right)
& v_{2}\left(\alpha_{2}^{\ell}+ \eta \alpha_{2}^{q-2}\right) &\cdots &
v_{n}\left(\alpha_{n}^{\ell}+\eta\alpha_{n}^{q-2}\right) \end{array}\right) \]
where $0\leq \ell\leq k-1,$ the evaluation set
$D=\{\alpha_{1},\alpha_{2},\cdots, \alpha_{n}\}\subseteq \mathbb{F}_q^*$,
scaling vector $\vec{v}=(v_1,v_2,\cdots,v_n)\in (\mathbb{F}_q^*)^n$ and
$\eta\in\mathbb{F}_q^*$. The minimum distance and dual code of $C_\ell(D, k,
\eta, \vec{v})$ will be determined. For the special case $\ell=k-1,$ a
sufficient and necessary condition for $C_{k-1}(D, k, \eta, \vec{v})$ to be
self-dual will be given. We will also show that the code is MDS or near-MDS.
Moreover, a complete classification when the code is near-MDS or MDS will be
presented.
