management 2019s discussion and analysis 74 jpmorgan chase & co./2017 annual report treasury and cio overview treasury and cio is predominantly responsible for measuring , monitoring , reporting and managing the firm 2019s liquidity , funding and structural interest rate and foreign exchange risks , as well as executing the firm 2019s capital plan . the risks managed by treasury and cio arise from the activities undertaken by the firm 2019s four major reportable business segments to serve their respective client bases , which generate both on- and off-balance sheet assets and liabilities . treasury and cio seek to achieve the firm 2019s asset-liability management objectives generally by investing in high- quality securities that are managed for the longer-term as part of the firm 2019s investment securities portfolio . treasury and cio also use derivatives to meet the firm 2019s asset- liability management objectives . for further information on derivatives , see note 5 . the investment securities portfolio primarily consists of agency and nonagency mortgage- backed securities , u.s . and non-u.s . government securities , obligations of u.s . states and municipalities , other abs and corporate debt securities . at december 31 , 2017 , the investment securities portfolio was $ 248.0 billion , and the average credit rating of the securities comprising the portfolio was aa+ ( based upon external ratings where available and where not available , based primarily upon internal ratings that correspond to ratings as defined by s&p and moody 2019s ) . see note 10 for further information on the details of the firm 2019s investment securities portfolio . for further information on liquidity and funding risk , see liquidity risk management on pages 92 201397 . for information on interest rate , foreign exchange and other risks , see market risk management on pages 121-128 . selected income statement and balance sheet data as of or for the year ended december 31 , ( in millions ) 2017 2016 2015 .
afs investment securities ( average ) 219345 226892 264758 htm investment securities ( average ) 47927 51358 50044 investment securities portfolio ( average ) 267272 278250 314802 afs investment securities ( period-end ) 200247 236670 238704 htm investment securities ( period-end ) 47733 50168 49073 investment securities portfolio ( period 2013end ) 247980 286838 287777 .
As of or for the year ended December 31, (in millions) 2017 2016 2015
Securities gains/(losses) $(78) $132 $190
AFS investment securities (average) 219,345 226,892 264,758
HTM investment securities (average) 47,927 51,358 50,044
Investment securities portfolio (average) 267,272 278,250 314,802
AFS investment securities (period-end) 200,247 236,670 238,704
HTM investment securities (period-end) 47,733 50,168 49,073
Investment securities portfolio (period–end) 247,980 286,838 287,777
as of or for the year ended december 31 ( in millions ) 2017 2016 2015
securities gains/ ( losses ) $ -78 ( 78 ) $ 132 $ 190
afs investment securities ( average ) 219345 226892 264758
htm investment securities ( average ) 47927 51358 50044
investment securities portfolio ( average ) 267272 278250 314802
afs investment securities ( period-end ) 200247 236670 238704
htm investment securities ( period-end ) 47733 50168 49073
investment securities portfolio ( period 2013end ) 247980 286838 287777